You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 2, 2022. It is now read-only.
preg_match('/^Since (.+?), there have been (\d+) modifications and (\d+) questions. I have been alive for (.+?), I currently know (\d+)/', $info, $matches);
139
81
$game = $discord->factory(Game::class, [
@@ -214,7 +156,7 @@ function sporks($user, $content, $randomnick = "")
214
156
}
215
157
}
216
158
if (!$access) {
217
-
$message->channel->sendMessage("Sorry, <@" . $author->id . ">, you require the \"manage messages\" permission to alter configuration for <#".$global_last_message->d->channel_id.">");
159
+
$message->channel->sendMessage("Sorry, <@" . $author->id . ">, you must be in a role with the \"manage messages\" permission to alter configuration for <#".$global_last_message->d->channel_id."> (or be server owner or an administrator)");
218
160
return;
219
161
}
220
162
switch ($params[2]) {
@@ -255,15 +197,15 @@ function sporks($user, $content, $randomnick = "")
if (isset($chanconfig['ignores']) && is_array($chanconfig['ignores'])) {
264
206
$user_array = $chanconfig['ignores'];
265
207
}
266
-
if (strtolower($add_or_del) == 'add') {
208
+
if ($add_or_del == 'add') {
267
209
if ($userid == $discord->id) {
268
210
$message->channel->sendMessage("", false, ["color"=>0xffda00,"description"=>"Confucious say, only an idiot would ignore their inner voice..."]);
269
211
return;
@@ -275,25 +217,36 @@ function sporks($user, $content, $randomnick = "")
275
217
} else {
276
218
$message->channel->sendMessage("", false, ["color"=>0xffda00,"description"=>"You can't add an ignore on yourself on <#" . $global_last_message->d->channel_id .">!"]);
277
219
}
278
-
} elseif (strtolower($add_or_del) == 'del') {
220
+
} elseif ($add_or_del == 'del') {
279
221
if (($key = array_search($userid, $user_array)) !== false) {
$message->channel->sendMessage("", false, ["color"=>0xffda00,"description"=>"User <@".$userid."> removed from ignore list on <#" . $global_last_message->d->channel_id .">"]);
283
225
} else {
284
226
$message->channel->sendMessage("", false, ["color"=>0xffda00,"description"=>"User <@".$userid."> does not exist on ignore list on <#" . $global_last_message->d->channel_id .">!"]);
285
227
}
286
-
} elseif (strtolower($add_or_del) == 'list') {
287
-
$descr = "**Ignore list for <#" . $global_last_message->d->channel_id .">**\r\n\r\n";
288
-
foreach ($user_arrayas$user_id) {
289
-
$descr .= "<@" . $user_id . "> ($user_id)\r\n";
228
+
} elseif ($add_or_del == 'list') {
229
+
if (count($user_array)) {
230
+
$descr = "**Ignore list for <#" . $global_last_message->d->channel_id .">**\r\n\r\n";
231
+
foreach ($user_arrayas$user_id) {
232
+
$descr .= "<@" . $user_id . "> ($user_id)\r\n";
233
+
}
234
+
} else {
235
+
$descr = "**Ignore list for <#" . $global_last_message->d->channel_id .">** is **empty**!";
$message->channel->sendMessage("", false, ["color"=>0xffda00,"description"=>"User to add or delete on <#" . $global_last_message->d->channel_id ."> must be referred to as a metion"]);
$message->channel->sendMessage("", false, ["color"=>0xff0000, "description"=>"Invalid config ignore command '**$params[3]**', should be '**add**', '**del**' or '**list**'"]);
242
+
} else {
243
+
$message->channel->sendMessage("", false, ["color"=>0xffda00,"description"=>"User to add or delete on <#" . $global_last_message->d->channel_id ."> must be referred to as a metion"]);
244
+
}
295
245
}
296
246
break;
247
+
default:
248
+
$message->channel->sendMessage("", false, ["color"=>0xff0000, "description"=>"Invalid config command '**$params[2]**', should be '**set**', '**show**' or '**ignore**'"]);
249
+
break;
297
250
}
298
251
return;
299
252
}
@@ -327,9 +280,11 @@ function sporks($user, $content, $randomnick = "")
327
280
}
328
281
}
329
282
283
+
$found = 0;
284
+
330
285
/* When learning is not disabled, bot is always learning */
0 commit comments