@@ -277,20 +277,24 @@ discard block |
||
| 277 | 277 | $content = explode(' ', $message->content); |
| 278 | 278 | foreach ($this->onMessage as $command => $data) { |
| 279 | 279 | $parts = []; |
| 280 | - foreach ($content as $index => $c) |
|
| 281 | - foreach (explode("\n", $c) as $p) |
|
| 280 | + foreach ($content as $index => $c) { |
|
| 281 | + foreach (explode("\n", $c) as $p) |
|
| 282 | 282 | $parts[] = $p; |
| 283 | + } |
|
| 283 | 284 | |
| 284 | 285 | if ($parts[0] === $config->prefix . $command) { |
| 285 | 286 | // If they are listed under the admins array in the bot config, they're the super admins |
| 286 | - if (in_array($message->author->id, $this->globalConfig->get('admins', 'permissions'))) |
|
| 287 | - $userPerms = 3; |
|
| 287 | + if (in_array($message->author->id, $this->globalConfig->get('admins', 'permissions'))) { |
|
| 288 | + $userPerms = 3; |
|
| 289 | + } |
|
| 288 | 290 | // If they are guild owner, they're automatically getting permission level 2 |
| 289 | - elseif (null !== $message->getChannelAttribute()->getGuildAttribute()->owner_id && ($message->author->id === $message->getChannelAttribute()->getGuildAttribute()->owner_id)) |
|
| 290 | - $userPerms = 2; |
|
| 291 | + elseif (null !== $message->getChannelAttribute()->getGuildAttribute()->owner_id && ($message->author->id === $message->getChannelAttribute()->getGuildAttribute()->owner_id)) { |
|
| 292 | + $userPerms = 2; |
|
| 293 | + } |
|
| 291 | 294 | // Everyone else are just users |
| 292 | - else |
|
| 293 | - $userPerms = 1; |
|
| 295 | + else { |
|
| 296 | + $userPerms = 1; |
|
| 297 | + } |
|
| 294 | 298 | |
| 295 | 299 | if ($userPerms >= $data['permissions']) { |
| 296 | 300 | try { |
@@ -331,8 +335,9 @@ discard block |
||
| 331 | 335 | foreach ($this->onVoice as $command => $data) { |
| 332 | 336 | $parts = []; |
| 333 | 337 | foreach ($content as $index => $c) { |
| 334 | - foreach (explode("\n", $c) as $p) |
|
| 335 | - $parts[] = $p; |
|
| 338 | + foreach (explode("\n", $c) as $p) { |
|
| 339 | + $parts[] = $p; |
|
| 340 | + } |
|
| 336 | 341 | } |
| 337 | 342 | |
| 338 | 343 | if ($parts[0] === $config->prefix . $command) { |
@@ -96,10 +96,11 @@ |
||
| 96 | 96 | if (isset($cmd)) { |
| 97 | 97 | foreach ($plugins as $command => $data) { |
| 98 | 98 | if ($command == $cmd) { |
| 99 | - if ($data["usage"]) |
|
| 100 | - $this->message->reply("**{$this->channelConfig->prefix}{$command}** _{$data["usage"]}_\r\n {$data["description"]}"); |
|
| 101 | - else |
|
| 102 | - $this->message->reply("**{$this->channelConfig->prefix}{$command}** \r\n {$data["description"]}"); |
|
| 99 | + if ($data["usage"]) { |
|
| 100 | + $this->message->reply("**{$this->channelConfig->prefix}{$command}** _{$data["usage"]}_\r\n {$data["description"]}"); |
|
| 101 | + } else { |
|
| 102 | + $this->message->reply("**{$this->channelConfig->prefix}{$command}** \r\n {$data["description"]}"); |
|
| 103 | + } |
|
| 103 | 104 | } |
| 104 | 105 | } |
| 105 | 106 | } else { |
@@ -125,10 +125,11 @@ |
||
| 125 | 125 | foreach($categories as $catName => $catURL) { |
| 126 | 126 | $categoryNames[] = ucfirst($catName); |
| 127 | 127 | if(strtolower($type) == strtolower($catName)) { |
| 128 | - if(is_array($catURL)) |
|
| 129 | - $url = $catURL[array_rand($catURL)]; |
|
| 130 | - else |
|
| 131 | - $url = $catURL; |
|
| 128 | + if(is_array($catURL)) { |
|
| 129 | + $url = $catURL[array_rand($catURL)]; |
|
| 130 | + } else { |
|
| 131 | + $url = $catURL; |
|
| 132 | + } |
|
| 132 | 133 | } |
| 133 | 134 | } |
| 134 | 135 | |
@@ -92,8 +92,9 @@ |
||
| 92 | 92 | } |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | - if(!$url) |
|
| 96 | - $message->reply("You can listen to the following radios: " . implode(", ", $radioNames)); |
|
| 95 | + if(!$url) { |
|
| 96 | + $message->reply("You can listen to the following radios: " . implode(", ", $radioNames)); |
|
| 97 | + } |
|
| 97 | 98 | |
| 98 | 99 | if (!empty($url)) { |
| 99 | 100 | $webSocket->joinVoiceChannel($channel)->then(function (VoiceClient $vc) use ($message, $discord, &$webSocket, $log, &$audioStreams, $channel, $curl, $url) { |