@@ -133,7 +133,7 @@ |
||
| 133 | 133 | 'motd' => array( |
| 134 | 134 | 'keyID' => '', //char api keyID (Must have channel on api and mod rights on the char) |
| 135 | 135 | 'vCode' => '', //char api vCode |
| 136 | - 'characterID' => , //ID Of the character with mod rights to the channel, can get this from zkill, look up your char and its /character/#### is your char ID |
|
| 136 | + 'characterID' =>, //ID Of the character with mod rights to the channel, can get this from zkill, look up your char and its /character/#### is your char ID |
|
| 137 | 137 | 'channelname' => '', //name of channel you are requesting, must be IDENTICAL |
| 138 | 138 | ), |
| 139 | 139 | // what channel for eve notifications/also the channel for tq status alerts |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | ), |
| 131 | 131 | ), |
| 132 | 132 | //Pull MOTD of channel |
| 133 | - 'motd' => array( |
|
| 133 | + 'motd' => array( |
|
| 134 | 134 | 'keyID' => '', //char api keyID (Must have channel on api and mod rights on the char) |
| 135 | 135 | 'vCode' => '', //char api vCode |
| 136 | 136 | 'characterID' => , //ID Of the character with mod rights to the channel, can get this from zkill, look up your char and its /character/#### is your char ID |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | 'lossMails' => 'true', //set as true to post both kills and losses, false to post only kills. |
| 197 | 197 | 'startMail' => 1, //Put the zkill killID of your latest killmail. Otherwise it will pull from the beginning of time. |
| 198 | 198 | 'minimumValue' => 0, //Put the minimum isk value for killmails here (Do not put any commas just numbers) |
| 199 | - 'minimumlossValue' => 0, //Put the minimum isk loss value for killmails here (Do not put any commas just numbers) |
|
| 199 | + 'minimumlossValue' => 0, //Put the minimum isk loss value for killmails here (Do not put any commas just numbers) |
|
| 200 | 200 | 'bigKill' => null, //Set an isk amount you'd like to consider a high value kill, will alert the channel if any kills/losses hit this amount. (Leave as null if you don't want this feature) |
| 201 | 201 | 'bigKillChannel' => 0, //what channel does the bot post big kills into (must be set, if ud like to use one channel just put the same u put above here) |
| 202 | 202 | ), |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | 'lossMails' => 'true', //set as true to post both kills and losses, false to post only kills. |
| 209 | 209 | 'startMail' => 1, //Put the zkill killID of your latest killmail. Otherwise it will pull from the beginning of time. |
| 210 | 210 | 'minimumValue' => 0, //Put the minimum isk value for killmails here (Do not put any commas just numbers) |
| 211 | - 'minimumlossValue' => 0, //Put the minimum isk loss value for killmails here (Do not put any commas just numbers) |
|
| 211 | + 'minimumlossValue' => 0, //Put the minimum isk loss value for killmails here (Do not put any commas just numbers) |
|
| 212 | 212 | 'bigKill' => null, //Set an isk amount you'd like to consider a high value kill, will alert the channel if any kills/losses hit this amount. (Leave as null if you don't want this feature) |
| 213 | 213 | 'bigKillChannel' => 0, //what channel does the bot post big kills into (must be set, if ud like to use one channel just put the same u put above here) |
| 214 | 214 | ), |
@@ -25,80 +25,80 @@ |
||
| 25 | 25 | /** |
| 26 | 26 | * @property message |
| 27 | 27 | */ |
| 28 | - class motd { |
|
| 29 | - public $config; |
|
| 30 | - public $discord; |
|
| 31 | - public $logger; |
|
| 32 | - public $message; |
|
| 33 | - private $excludeChannel; |
|
| 34 | - private $triggers; |
|
| 35 | - public function init($config, $discord, $logger) { |
|
| 36 | - $this->config = $config; |
|
| 37 | - $this->discord = $discord; |
|
| 38 | - $this->logger = $logger; |
|
| 39 | - $this->excludeChannel = $this->config['bot']['restrictedChannels']; |
|
| 40 | - $this->triggers[] = $this->config['bot']['trigger'] . 'motd'; |
|
| 41 | - $this->triggers[] = $this->config['bot']['trigger'] . 'Motd'; |
|
| 42 | - $this->triggers[] = $this->config['bot']['trigger'] . 'MOTD'; |
|
| 43 | - $this->keyID = $config['plugins']['motd']['keyID']; |
|
| 44 | - $this->vCode = $config['plugins']['motd']['vCode']; |
|
| 45 | - $this->characterID = $config['plugins']['motd']['characterID']; |
|
| 46 | - $this->channelname = $config['plugins']['motd']['channelname']; |
|
| 47 | - } |
|
| 48 | - public function onMessage($msgData, $message) { |
|
| 49 | - $channelID = (int) $msgData['message']['channelID']; |
|
| 50 | - if (in_array($channelID, $this->excludeChannel, true)) { |
|
| 51 | - return null; |
|
| 52 | - } |
|
| 53 | - $this->message = $message; |
|
| 54 | - $user = $msgData['message']['from']; |
|
| 55 | - $message = $msgData['message']['message']; |
|
| 56 | - $data = command($message, $this->information() ['trigger'], $this->config['bot']['trigger']); |
|
| 57 | - if (isset($data['trigger'])) { |
|
| 58 | - $keyID = $this->keyID; |
|
| 59 | - $vCode = $this->vCode; |
|
| 60 | - $characterID = $this->characterID; |
|
| 61 | - $channelname = $this->channelname; |
|
| 28 | + class motd { |
|
| 29 | + public $config; |
|
| 30 | + public $discord; |
|
| 31 | + public $logger; |
|
| 32 | + public $message; |
|
| 33 | + private $excludeChannel; |
|
| 34 | + private $triggers; |
|
| 35 | + public function init($config, $discord, $logger) { |
|
| 36 | + $this->config = $config; |
|
| 37 | + $this->discord = $discord; |
|
| 38 | + $this->logger = $logger; |
|
| 39 | + $this->excludeChannel = $this->config['bot']['restrictedChannels']; |
|
| 40 | + $this->triggers[] = $this->config['bot']['trigger'] . 'motd'; |
|
| 41 | + $this->triggers[] = $this->config['bot']['trigger'] . 'Motd'; |
|
| 42 | + $this->triggers[] = $this->config['bot']['trigger'] . 'MOTD'; |
|
| 43 | + $this->keyID = $config['plugins']['motd']['keyID']; |
|
| 44 | + $this->vCode = $config['plugins']['motd']['vCode']; |
|
| 45 | + $this->characterID = $config['plugins']['motd']['characterID']; |
|
| 46 | + $this->channelname = $config['plugins']['motd']['channelname']; |
|
| 47 | + } |
|
| 48 | + public function onMessage($msgData, $message) { |
|
| 49 | + $channelID = (int) $msgData['message']['channelID']; |
|
| 50 | + if (in_array($channelID, $this->excludeChannel, true)) { |
|
| 51 | + return null; |
|
| 52 | + } |
|
| 53 | + $this->message = $message; |
|
| 54 | + $user = $msgData['message']['from']; |
|
| 55 | + $message = $msgData['message']['message']; |
|
| 56 | + $data = command($message, $this->information() ['trigger'], $this->config['bot']['trigger']); |
|
| 57 | + if (isset($data['trigger'])) { |
|
| 58 | + $keyID = $this->keyID; |
|
| 59 | + $vCode = $this->vCode; |
|
| 60 | + $characterID = $this->characterID; |
|
| 61 | + $channelname = $this->channelname; |
|
| 62 | 62 | |
| 63 | 63 | $urlChar = "https://api.eveonline.com/char/ChatChannels.xml.aspx?keyID=$keyID&vCode=$vCode&characterID=$characterID"; |
| 64 | - $data = file_get_contents($urlChar); |
|
| 65 | - $list = new SimpleXMLElement($data); |
|
| 64 | + $data = file_get_contents($urlChar); |
|
| 65 | + $list = new SimpleXMLElement($data); |
|
| 66 | 66 | |
| 67 | 67 | |
| 68 | - foreach ($list->result->rowset->row as $row) { |
|
| 69 | - $channeln = $row["displayName"]; |
|
| 68 | + foreach ($list->result->rowset->row as $row) { |
|
| 69 | + $channeln = $row["displayName"]; |
|
| 70 | 70 | |
| 71 | - if ($channeln == $channelname) { |
|
| 72 | - //scrub the motd, then break it into 1900 chars or less. Limit is 2000 and want to leave room for the name of the person being replied too |
|
| 73 | - $comment = $row["motd"]; |
|
| 74 | - $comment = str_replace("<BR>", "\n", $comment); |
|
| 75 | - $comment = str_replace("<br>", "\n", $comment); |
|
| 76 | - $comment = str_replace("<u>", "__", $comment); |
|
| 77 | - $comment = str_replace("</u>", "__", $comment); |
|
| 78 | - $comment = str_replace("<b>", "**", $comment); |
|
| 79 | - $comment = str_replace("</b>", "**", $comment); |
|
| 80 | - $comment = str_replace("<i>", "*", $comment); |
|
| 81 | - $comment = str_replace("</i>", "*", $comment); |
|
| 82 | - $comment = str_replace("&", "&", $comment); |
|
| 83 | - $comment = strip_tags($comment); |
|
| 84 | - $comment2 = str_split($comment, 1900); |
|
| 71 | + if ($channeln == $channelname) { |
|
| 72 | + //scrub the motd, then break it into 1900 chars or less. Limit is 2000 and want to leave room for the name of the person being replied too |
|
| 73 | + $comment = $row["motd"]; |
|
| 74 | + $comment = str_replace("<BR>", "\n", $comment); |
|
| 75 | + $comment = str_replace("<br>", "\n", $comment); |
|
| 76 | + $comment = str_replace("<u>", "__", $comment); |
|
| 77 | + $comment = str_replace("</u>", "__", $comment); |
|
| 78 | + $comment = str_replace("<b>", "**", $comment); |
|
| 79 | + $comment = str_replace("</b>", "**", $comment); |
|
| 80 | + $comment = str_replace("<i>", "*", $comment); |
|
| 81 | + $comment = str_replace("</i>", "*", $comment); |
|
| 82 | + $comment = str_replace("&", "&", $comment); |
|
| 83 | + $comment = strip_tags($comment); |
|
| 84 | + $comment2 = str_split($comment, 1900); |
|
| 85 | 85 | |
| 86 | - $this->message->reply("\n $comment2[0]"); |
|
| 87 | - if (!empty($comment2[1])) { |
|
| 88 | - $this->message->reply("\n $comment2[1]"); |
|
| 89 | - } |
|
| 90 | - if (!empty($comment2[2])) { |
|
| 91 | - $this->message->reply("\n $comment2[2]"); |
|
| 92 | - } |
|
| 93 | - if (!empty($comment2[3])) { |
|
| 94 | - $this->message->reply("\n $comment2[3]"); |
|
| 95 | - } |
|
| 96 | - } |
|
| 97 | - } |
|
| 98 | - } |
|
| 99 | - } |
|
| 100 | - public function information() { |
|
| 86 | + $this->message->reply("\n $comment2[0]"); |
|
| 87 | + if (!empty($comment2[1])) { |
|
| 88 | + $this->message->reply("\n $comment2[1]"); |
|
| 89 | + } |
|
| 90 | + if (!empty($comment2[2])) { |
|
| 91 | + $this->message->reply("\n $comment2[2]"); |
|
| 92 | + } |
|
| 93 | + if (!empty($comment2[3])) { |
|
| 94 | + $this->message->reply("\n $comment2[3]"); |
|
| 95 | + } |
|
| 96 | + } |
|
| 97 | + } |
|
| 98 | + } |
|
| 99 | + } |
|
| 100 | + public function information() { |
|
| 101 | 101 | return array('name' => 'motd', 'trigger' => $this->triggers, 'information' => 'Displays the BurntOutWebs MOTD, useful for seeing upcoming ops when not in-game.'); |
| 102 | - } |
|
| 103 | - } |
|
| 102 | + } |
|
| 103 | + } |
|
| 104 | 104 | ?> |
@@ -194,22 +194,22 @@ discard block |
||
| 194 | 194 | $allianceContacts = getContacts($allianceID); |
| 195 | 195 | $corpContacts = getContacts($corpID); |
| 196 | 196 | foreach ($roles as $role) { |
| 197 | - if ((@(int)$allianceContacts['standing'] === 5 || @(int)$corpContacts['standing'] === 5) && (string)$role->name === (string)$this->config['plugins']['auth']['standings']['plus5Role']) { |
|
| 197 | + if ((@(int) $allianceContacts['standing'] === 5 || @(int) $corpContacts['standing'] === 5) && (string) $role->name === (string) $this->config['plugins']['auth']['standings']['plus5Role']) { |
|
| 198 | 198 | $member->addRole($role); |
| 199 | 199 | $role = 'blue'; |
| 200 | 200 | break; |
| 201 | 201 | } |
| 202 | - if ((@(int)$allianceContacts['standing'] === 10 || @(int)$corpContacts['standing'] === 10) && (string)$role->name === (string)$this->config['plugins']['auth']['standings']['plus10Role']) { |
|
| 202 | + if ((@(int) $allianceContacts['standing'] === 10 || @(int) $corpContacts['standing'] === 10) && (string) $role->name === (string) $this->config['plugins']['auth']['standings']['plus10Role']) { |
|
| 203 | 203 | $member->addRole($role); |
| 204 | 204 | $role = 'blue'; |
| 205 | 205 | break; |
| 206 | 206 | } |
| 207 | - if ((@(int)$allianceContacts['standing'] === -5 || @(int)$corpContacts['standing'] === -5) && (string)$role->name === (string)$this->config['plugins']['auth']['standings']['minus5Role']) { |
|
| 207 | + if ((@(int) $allianceContacts['standing'] === -5 || @(int) $corpContacts['standing'] === -5) && (string) $role->name === (string) $this->config['plugins']['auth']['standings']['minus5Role']) { |
|
| 208 | 208 | $member->addRole($role); |
| 209 | 209 | $role = 'red'; |
| 210 | 210 | break; |
| 211 | 211 | } |
| 212 | - if ((@(int)$allianceContacts['standing'] === -10 || @(int)$corpContacts['standing'] === -10) && (string)$role->name === (string)$this->config['plugins']['auth']['standings']['minus10Role']) { |
|
| 212 | + if ((@(int) $allianceContacts['standing'] === -10 || @(int) $corpContacts['standing'] === -10) && (string) $role->name === (string) $this->config['plugins']['auth']['standings']['minus10Role']) { |
|
| 213 | 213 | $member->addRole($role); |
| 214 | 214 | $role = 'red'; |
| 215 | 215 | break; |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | } |
| 218 | 218 | if ($role === null) { |
| 219 | 219 | foreach ($roles as $role) { |
| 220 | - if ((string)$role->name === (string)$this->config['plugins']['auth']['standings']['neutralRole']) { |
|
| 220 | + if ((string) $role->name === (string) $this->config['plugins']['auth']['standings']['neutralRole']) { |
|
| 221 | 221 | $member->addRole($role); |
| 222 | 222 | $role = 'neut'; |
| 223 | 223 | break; |
@@ -202,17 +202,17 @@ |
||
| 202 | 202 | if ($role === 'blue' || 'neut' || 'red') { |
| 203 | 203 | $allianceContacts = getContacts($allianceID); |
| 204 | 204 | $corpContacts = getContacts($corporationID); |
| 205 | - if ($role === 'blue' && ((int)$allianceContacts['standing'] === 5 || 10 || (int)$corpContacts['standing'] === 5 || 10)) { |
|
| 205 | + if ($role === 'blue' && ((int) $allianceContacts['standing'] === 5 || 10 || (int) $corpContacts['standing'] === 5 || 10)) { |
|
| 206 | 206 | $standings = 1; |
| 207 | 207 | } |
| 208 | - if ($role === 'red' && ((int)$allianceContacts['standing'] === -5 || -10 || (int)$corpContacts['standing'] === -5 || -10)) { |
|
| 208 | + if ($role === 'red' && ((int) $allianceContacts['standing'] === -5 || -10 || (int) $corpContacts['standing'] === -5 || -10)) { |
|
| 209 | 209 | $standings = 1; |
| 210 | 210 | } |
| 211 | - if ($role === 'neut' && ((int)$allianceContacts['standing'] === 0 || (int)$corpContacts['standing'] === 0 || (@(int)$allianceContacts['standings'] === null || '' && @(int)$corpContacts['standings'] === null || ''))) { |
|
| 211 | + if ($role === 'neut' && ((int) $allianceContacts['standing'] === 0 || (int) $corpContacts['standing'] === 0 || (@(int) $allianceContacts['standings'] === null || '' && @(int) $corpContacts['standings'] === null || ''))) { |
|
| 212 | 212 | $standings = 1; |
| 213 | 213 | } |
| 214 | 214 | } |
| 215 | - if (!in_array((int)$allianceID, $allianceArray) && !in_array((int)$corporationID, $corpArray) && null === $standings) { |
|
| 215 | + if (!in_array((int) $allianceID, $allianceArray) && !in_array((int) $corporationID, $corpArray) && null === $standings) { |
|
| 216 | 216 | // Deactivate user in database |
| 217 | 217 | $sql = "UPDATE authUsers SET active='no' WHERE discordID='$discordID'"; |
| 218 | 218 | $this->logger->addInfo("AuthCheck: {$eveName} account has been deactivated as they are no longer in a correct corp/alliance."); |