@@ -31,7 +31,7 @@ |
||
| 31 | 31 | "trigger" => "!", // what trigger is used for commands |
| 32 | 32 | "guild" => 152677265635803136, // guildID |
| 33 | 33 | "token" => "", //enter the token for your app (https://discordapp.com/developers/applications/me) |
| 34 | - "adminRoles" => array("Admin","")//enter the roles that you'd like to have access to admin commands |
|
| 34 | + "adminRoles" => array("Admin","")//enter the roles that you'd like to have access to admin commands |
|
| 35 | 35 | ); |
| 36 | 36 | |
| 37 | 37 | $config["database"] = array( |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | "trigger" => "!", // what trigger is used for commands |
| 32 | 32 | "guild" => 152677265635803136, // guildID |
| 33 | 33 | "token" => "", //enter the token for your app (https://discordapp.com/developers/applications/me) |
| 34 | - "adminRoles" => array("Admin","")//enter the roles that you'd like to have access to admin commands |
|
| 34 | + "adminRoles" => array("Admin", "")//enter the roles that you'd like to have access to admin commands |
|
| 35 | 35 | ); |
| 36 | 36 | |
| 37 | 37 | $config["database"] = array( |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | "alertChannel" => 0, // if using periodic check put the channel you'd like the bot to log removing users in. (Recommended you don't use an active chat channel) |
| 135 | 135 | "nameEnforce" => "false", // if "true" bot will automatically change nicknames so that they match player names. |
| 136 | 136 | "url" => "http://.....", // put a url here if using sso auth for ur sso page. |
| 137 | - "exempt" => array("","") // role names that are exempt from auth checks (wont be removed by the bot) |
|
| 137 | + "exempt" => array("", "") // role names that are exempt from auth checks (wont be removed by the bot) |
|
| 138 | 138 | ), |
| 139 | 139 | //Killmail posting |
| 140 | 140 | "getKillmails" => array( |
@@ -102,8 +102,8 @@ |
||
| 102 | 102 | $plugins = array(); |
| 103 | 103 | foreach ($pluginDirs as $dir) { |
| 104 | 104 | foreach (glob($dir) as $plugin) { |
| 105 | - var_dump($plugin); |
|
| 106 | - var_dump($adminPlugins); |
|
| 105 | + var_dump($plugin); |
|
| 106 | + var_dump($adminPlugins); |
|
| 107 | 107 | // Only load the plugins we want to load, according to the config |
| 108 | 108 | if (!in_array(str_replace(".php", "", basename($plugin)), $config["enabledPlugins"]) && in_array(str_replace(".php", "", basename($plugin), $adminPlugins))) { |
| 109 | 109 | continue; |
@@ -97,7 +97,7 @@ |
||
| 97 | 97 | |
| 98 | 98 | // Load chat plugins |
| 99 | 99 | $pluginDirs = array("src/plugins/onMessage/*.php", "src/plugins/admin/*.php"); |
| 100 | -$adminPlugins = array("setNickname","updateBot","holder"); |
|
| 100 | +$adminPlugins = array("setNickname", "updateBot", "holder"); |
|
| 101 | 101 | $logger->addInfo("Loading in chat plugins"); |
| 102 | 102 | $plugins = array(); |
| 103 | 103 | foreach ($pluginDirs as $dir) { |
@@ -74,32 +74,32 @@ |
||
| 74 | 74 | $data = command($message, $this->information()["trigger"], $this->config["bot"]["trigger"]); |
| 75 | 75 | if (isset($data["trigger"])) {
|
| 76 | 76 | |
| 77 | - //Admin Check |
|
| 78 | - $botID = $this->discord->id; |
|
| 79 | - $userID = $msgData["message"]["fromID"]; |
|
| 77 | + //Admin Check |
|
| 78 | + $botID = $this->discord->id; |
|
| 79 | + $userID = $msgData["message"]["fromID"]; |
|
| 80 | 80 | $adminRoles = $this->config["bot"]["adminRoles"]; |
| 81 | 81 | $id = $this->config["bot"]["guild"]; |
| 82 | 82 | $guild = $this->discord->guilds->get('id', $id);
|
| 83 | - $member = $guild->members->get("id", $userID);
|
|
| 84 | - $roles = $member->roles; |
|
| 85 | - foreach ($roles as $role) {
|
|
| 83 | + $member = $guild->members->get("id", $userID);
|
|
| 84 | + $roles = $member->roles; |
|
| 85 | + foreach ($roles as $role) {
|
|
| 86 | 86 | if(!isset($role->name)){
|
| 87 | 87 | if(!in_array($role->name, $adminRoles, true)){
|
| 88 | 88 | $msg = ":bangbang: You do not have the necessary roles to issue this command :bangbang:"; |
| 89 | - $this->message->reply($msg); |
|
| 90 | - return null; |
|
| 89 | + $this->message->reply($msg); |
|
| 90 | + return null; |
|
| 91 | 91 | } |
| 92 | 92 | } |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | $update = updateBot($this->logger); |
| 96 | - if ($update = "1"){
|
|
| 97 | - $msg = "Bot succesfully updated, restarting."; |
|
| 98 | - $this->logger->addInfo("Bot succesfully updated, restarting.");
|
|
| 99 | - $this->message->reply($msg); |
|
| 100 | - sleep(5); |
|
| 101 | - die(); |
|
| 102 | - } |
|
| 96 | + if ($update = "1"){
|
|
| 97 | + $msg = "Bot succesfully updated, restarting."; |
|
| 98 | + $this->logger->addInfo("Bot succesfully updated, restarting.");
|
|
| 99 | + $this->message->reply($msg); |
|
| 100 | + sleep(5); |
|
| 101 | + die(); |
|
| 102 | + } |
|
| 103 | 103 | } |
| 104 | 104 | } |
| 105 | 105 | |
@@ -83,8 +83,8 @@ discard block |
||
| 83 | 83 | $member = $guild->members->get("id", $userID);
|
| 84 | 84 | $roles = $member->roles; |
| 85 | 85 | foreach ($roles as $role) {
|
| 86 | - if(!isset($role->name)){
|
|
| 87 | - if(!in_array($role->name, $adminRoles, true)){
|
|
| 86 | + if (!isset($role->name)) {
|
|
| 87 | + if (!in_array($role->name, $adminRoles, true)) {
|
|
| 88 | 88 | $msg = ":bangbang: You do not have the necessary roles to issue this command :bangbang:"; |
| 89 | 89 | $this->message->reply($msg); |
| 90 | 90 | return null; |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | $update = updateBot($this->logger); |
| 96 | - if ($update = "1"){
|
|
| 96 | + if ($update = "1") {
|
|
| 97 | 97 | $msg = "Bot succesfully updated, restarting."; |
| 98 | 98 | $this->logger->addInfo("Bot succesfully updated, restarting.");
|
| 99 | 99 | $this->message->reply($msg); |
@@ -74,20 +74,20 @@ |
||
| 74 | 74 | $data = command($message, $this->information()["trigger"], $this->config["bot"]["trigger"]); |
| 75 | 75 | if (isset($data["trigger"])) {
|
| 76 | 76 | |
| 77 | - //Admin Check |
|
| 78 | - $botID = $this->discord->id; |
|
| 79 | - $userID = $msgData["message"]["fromID"]; |
|
| 77 | + //Admin Check |
|
| 78 | + $botID = $this->discord->id; |
|
| 79 | + $userID = $msgData["message"]["fromID"]; |
|
| 80 | 80 | $adminRoles = $this->config["bot"]["adminRoles"]; |
| 81 | 81 | $id = $this->config["bot"]["guild"]; |
| 82 | 82 | $guild = $this->discord->guilds->get('id', $id);
|
| 83 | - $member = $guild->members->get("id", $userID);
|
|
| 84 | - $roles = $member->roles; |
|
| 85 | - foreach ($roles as $role) {
|
|
| 83 | + $member = $guild->members->get("id", $userID);
|
|
| 84 | + $roles = $member->roles; |
|
| 85 | + foreach ($roles as $role) {
|
|
| 86 | 86 | if(!isset($role->name)){
|
| 87 | 87 | if(!in_array($role->name, $adminRoles, true)){
|
| 88 | 88 | $msg = ":bangbang: You do not have the necessary roles to issue this command :bangbang:"; |
| 89 | - $this->message->reply($msg); |
|
| 90 | - return null; |
|
| 89 | + $this->message->reply($msg); |
|
| 90 | + return null; |
|
| 91 | 91 | } |
| 92 | 92 | } |
| 93 | 93 | } |
@@ -83,8 +83,8 @@ discard block |
||
| 83 | 83 | $member = $guild->members->get("id", $userID);
|
| 84 | 84 | $roles = $member->roles; |
| 85 | 85 | foreach ($roles as $role) {
|
| 86 | - if(!isset($role->name)){
|
|
| 87 | - if(!in_array($role->name, $adminRoles, true)){
|
|
| 86 | + if (!isset($role->name)) {
|
|
| 87 | + if (!in_array($role->name, $adminRoles, true)) {
|
|
| 88 | 88 | $msg = ":bangbang: You do not have the necessary roles to issue this command :bangbang:"; |
| 89 | 89 | $this->message->reply($msg); |
| 90 | 90 | return null; |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | $member = $guild->members->get("id", $botID);
|
| 96 | - $nick = (string)$data["messageString"]; |
|
| 96 | + $nick = (string) $data["messageString"]; |
|
| 97 | 97 | $member->setNickname($nick); |
| 98 | 98 | |
| 99 | 99 | $msg = "Bot nickname changed to **{$nick}** by {$msgData["message"]["from"]}";
|
@@ -29,12 +29,12 @@ |
||
| 29 | 29 | */ |
| 30 | 30 | function updateBot($logger) |
| 31 | 31 | {
|
| 32 | - $logger->addInfo("Updating Bot");
|
|
| 33 | - putenv("COMPOSER_HOME=/usr/local/bin/composer");
|
|
| 32 | + $logger->addInfo("Updating Bot");
|
|
| 33 | + putenv("COMPOSER_HOME=/usr/local/bin/composer");
|
|
| 34 | 34 | $output = shell_exec('sh ' . dirname(__FILE__) . '/update.sh');
|
| 35 | - if ($output = "1"){
|
|
| 36 | - $logger->addInfo("Update Complete");
|
|
| 37 | - return "1"; |
|
| 38 | - } |
|
| 35 | + if ($output = "1"){
|
|
| 36 | + $logger->addInfo("Update Complete");
|
|
| 37 | + return "1"; |
|
| 38 | + } |
|
| 39 | 39 | |
| 40 | 40 | } |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | $logger->addInfo("Updating Bot");
|
| 33 | 33 | putenv("COMPOSER_HOME=/usr/local/bin/composer");
|
| 34 | 34 | $output = shell_exec('sh ' . dirname(__FILE__) . '/update.sh');
|
| 35 | - if ($output = "1"){
|
|
| 35 | + if ($output = "1") {
|
|
| 36 | 36 | $logger->addInfo("Update Complete");
|
| 37 | 37 | return "1"; |
| 38 | 38 | } |