@@ -148,8 +148,9 @@ |
||
| 148 | 148 | |
| 149 | 149 | // Run the Tick plugins |
| 150 | 150 | $ws->loop->addPeriodicTimer(1, function () use ($pluginsT) { |
| 151 | - foreach ($pluginsT as $plugin) |
|
| 152 | - $plugin->tick(); |
|
| 151 | + foreach ($pluginsT as $plugin) { |
|
| 152 | + $plugin->tick(); |
|
| 153 | + } |
|
| 153 | 154 | }); |
| 154 | 155 | |
| 155 | 156 | // Mem cleanup every 30 minutes |
@@ -229,4 +229,4 @@ |
||
| 229 | 229 | { |
| 230 | 230 | } |
| 231 | 231 | } |
| 232 | - |
|
| 233 | 232 | \ No newline at end of file |
| 233 | + |
|
| 234 | 234 | \ No newline at end of file |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | $allyID = $this->config["plugins"]["auth"]["allianceID"]; |
| 112 | 112 | $corpID = $this->config["plugins"]["auth"]["corpID"]; |
| 113 | 113 | $exempt = $this->config["plugins"]["auth"]["exempt"]; |
| 114 | - if(is_null($exempt)){ |
|
| 114 | + if (is_null($exempt)) { |
|
| 115 | 115 | $exempt = "0"; |
| 116 | 116 | } |
| 117 | 117 | $toDiscordChannel = $this->config["plugins"]["auth"]["alertChannel"]; |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | |
| 123 | 123 | //Remove members who have roles but never authed |
| 124 | 124 | $guild = $discord->guilds->get('id', $id); |
| 125 | - foreach($guild->members as $member) { |
|
| 125 | + foreach ($guild->members as $member) { |
|
| 126 | 126 | $notifier = null; |
| 127 | 127 | $id = $member->id; |
| 128 | 128 | $username = $member->username; |
@@ -131,10 +131,10 @@ discard block |
||
| 131 | 131 | $sql = "SELECT * FROM authUsers WHERE discordID='$id' AND active='yes'"; |
| 132 | 132 | |
| 133 | 133 | $result = $conn->query($sql); |
| 134 | - if($result->num_rows == 0) { |
|
| 134 | + if ($result->num_rows == 0) { |
|
| 135 | 135 | foreach ($roles as $role) { |
| 136 | - if(!isset($role->name)){ |
|
| 137 | - if($id != $botID && !in_array($role->name, $exempt, true)){ |
|
| 136 | + if (!isset($role->name)) { |
|
| 137 | + if ($id != $botID && !in_array($role->name, $exempt, true)) { |
|
| 138 | 138 | $member->removeRole($role); |
| 139 | 139 | $guild->members->save($member); |
| 140 | 140 | // Send the info to the channel |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | $url = "https://api.eveonline.com/eve/CharacterAffiliation.xml.aspx?ids=$charID"; |
| 171 | 171 | $xml = makeApiRequest($url); |
| 172 | 172 | // Stop the process if the api is throwing an error |
| 173 | - if (is_null($xml)){ |
|
| 173 | + if (is_null($xml)) { |
|
| 174 | 174 | $this->logger->addInfo("{$eveName} cannot be authed, API issues detected."); |
| 175 | 175 | return null; |
| 176 | 176 | } |
@@ -66,8 +66,8 @@ |
||
| 66 | 66 | $logger->pushHandler(new StreamHandler(__DIR__ . '/log/libraryError.log', Logger::DEBUG)); |
| 67 | 67 | $userAgent = "Mozilla/5.0 (en-us;)"; |
| 68 | 68 | try { |
| 69 | - $opts = array ( |
|
| 70 | - 'http' => array ( |
|
| 69 | + $opts = array( |
|
| 70 | + 'http' => array( |
|
| 71 | 71 | 'method' => "GET", |
| 72 | 72 | 'user_agent' => $userAgent, |
| 73 | 73 | ) |
@@ -138,7 +138,7 @@ |
||
| 138 | 138 | foreach ($xml->result->rowset->row as $character) { |
| 139 | 139 | $member = $guild->members->get("id", $userID); |
| 140 | 140 | $inGameName = $character->attributes()->name; |
| 141 | - $nick = (string)$inGameName; |
|
| 141 | + $nick = (string) $inGameName; |
|
| 142 | 142 | $member->setNickname($nick); |
| 143 | 143 | } |
| 144 | 144 | } |
@@ -82,9 +82,9 @@ |
||
| 82 | 82 | $member = $guild->members->get("id", $userID);
|
| 83 | 83 | $roles = $member->roles; |
| 84 | 84 | foreach ($roles as $role) {
|
| 85 | - if(in_array($role->name, $adminRoles, true)){
|
|
| 85 | + if (in_array($role->name, $adminRoles, true)) {
|
|
| 86 | 86 | $member = $guild->members->get("id", $botID);
|
| 87 | - $nick = (string)$data["messageString"]; |
|
| 87 | + $nick = (string) $data["messageString"]; |
|
| 88 | 88 | $member->setNickname($nick); |
| 89 | 89 | |
| 90 | 90 | $msg = "Bot nickname changed to **{$nick}** by {$msgData["message"]["from"]}";
|
@@ -83,9 +83,9 @@ |
||
| 83 | 83 | $member = $guild->members->get("id", $userID);
|
| 84 | 84 | $roles = $member->roles; |
| 85 | 85 | foreach ($roles as $role) {
|
| 86 | - if(in_array($role->name, $adminRoles, true)){
|
|
| 86 | + if (in_array($role->name, $adminRoles, true)) {
|
|
| 87 | 87 | $update = updateBot($this->logger); |
| 88 | - if ($update == "1"){
|
|
| 88 | + if ($update == "1") {
|
|
| 89 | 89 | $msg = "Bot succesfully updated, restarting."; |
| 90 | 90 | $this->logger->addInfo("Bot succesfully updated, restarting.");
|
| 91 | 91 | $this->message->reply($msg); |
@@ -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 | "silentMode" => "false"//set this to true if you want to disable all the chat commands |
| 36 | 36 | ); |
| 37 | 37 | |
@@ -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 | "silentMode" => "false"//set this to true if you want to disable all the chat commands |
| 36 | 36 | ); |
| 37 | 37 | |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | "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) |
| 136 | 136 | "nameEnforce" => "false", // if "true" bot will automatically change nicknames so that they match player names. |
| 137 | 137 | "url" => "http://.....", // put a url here if using sso auth for ur sso page. |
| 138 | - "exempt" => array("","") // role names that are exempt from auth checks (wont be removed by the bot) |
|
| 138 | + "exempt" => array("", "") // role names that are exempt from auth checks (wont be removed by the bot) |
|
| 139 | 139 | ), |
| 140 | 140 | //Killmail posting |
| 141 | 141 | "getKillmails" => array( |
@@ -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 | - } |
|
| 39 | - return "0"; |
|
| 35 | + if ($output == "1"){
|
|
| 36 | + $logger->addInfo("Update Complete");
|
|
| 37 | + return "1"; |
|
| 38 | + } |
|
| 39 | + return "0"; |
|
| 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 | } |