Example #1
1
 public function run()
 {
     $sides = ["Heads", "Tails"];
     $this->message->reply("The result of the coinflip is: " . $sides[array_rand($sides)]);
     // Mark this as garbage
     $this->isGarbage();
 }
Example #2
0
 public function run()
 {
     $memes = array('dank meme', '>mfw no gf', "m'lady *tip*", 'le toucan has arrived', "jet juel can't melt dank memes", '༼ つ ◕_◕ ༽つ gibe', 'ヽ༼ຈل͜ຈ༽ノ raise your dongers ヽ༼ຈل͜ຈ༽ノ', 'ヽʕ •ᴥ•ʔノ raise your koalas ヽʕ •ᴥ•ʔノ', 'ಠ_ಠ', '(-‸ლ)', '( ͡° ͜ʖ ͡°)', '( ° ͜ʖ͡°)╭∩╮', '(╯°□°)╯︵ ┻━┻', '┬──┬ ノ( ゜-゜ノ)', '•_•) ( •_•)>⌐■-■ (⌐■_■)', "i dunno lol ¯\\(°_o)/¯", "how do i shot web ¯\\(°_o)/¯", '(◕‿◕✿)', 'ヾ(〃^∇^)ノ', '\( ̄▽ ̄)/', '(ノ◕ヮ◕)ノ*:・゚✧', 'ᕕ( ͡° ͜ʖ ͡°)ᕗ', 'ᕕ( ᐛ )ᕗ ᕕ( ᐛ )ᕗ ᕕ( ᐛ )ᕗ', "(ノ◕ヮ◕)ノ *:・゚✧ SO KAWAII ✧・:* \\(◕ヮ◕\\)", 'ᕙ༼ຈل͜ຈ༽ᕗ. ʜᴀʀᴅᴇʀ, ʙᴇᴛᴛᴇʀ, ғᴀsᴛᴇʀ, ᴅᴏɴɢᴇʀ .ᕙ༼ຈل͜ຈ༽ᕗ', "(∩ ͡° ͜ʖ ͡°)⊃━☆゚. * ・ 。゚you've been touched by the donger fairy", '(ง ͠° ͟ل͜ ͡°)ง ᴍᴀsᴛᴇʀ ʏᴏᴜʀ ᴅᴏɴɢᴇʀ, ᴍᴀsᴛᴇʀ ᴛʜᴇ ᴇɴᴇᴍʏ (ง ͠° ͟ل͜ ͡°)ง', "(⌐■_■)=/̵͇̿̿/'̿'̿̿̿ ̿ ̿̿ ヽ༼ຈل͜ຈ༽ノ keep your dongers where i can see them", '[̲̅$̲̅(̲̅ ͡° ͜ʖ ͡°̲̅)̲̅$̲̅] do you have change for a donger bill [̲̅$̲̅(̲̅ ͡° ͜ʖ ͡°̲̅)̲̅$̲̅]', '╰( ͡° ͜ʖ ͡° )つ──☆*:・゚ clickty clack clickty clack with this chant I summon spam to the chat', 'work it ᕙ༼ຈل͜ຈ༽ᕗ harder make it (ง •̀_•́)ง better do it ᕦ༼ຈل͜ຈ༽ᕤ faster raise ur ヽ༼ຈل͜ຈ༽ノ donger');
     $this->message->reply($memes[array_rand($memes)]);
     // Mark this as garbage
     $this->isGarbage();
 }
Example #3
0
 public function run()
 {
     $choices = array('It is certain', 'It is decidedly so', 'Without a doubt', 'Yes, definitely', 'You may rely on it', 'As I see it, yes', 'Most likely', 'More than likely', 'Outlook good', 'Yes', 'No', 'Lol no', 'Signs point to, yes', 'Reply hazy, try again', 'Ask again later', 'I Better not tell you now', 'I Cannot predict now', 'Concentrate and ask again', 'Don\'t count on it', 'My reply is no', 'My sources say no', 'Outlook not so good', 'Very doubtful');
     $this->message->reply($choices[array_rand($choices)]);
     // Mark this as garbage
     $this->isGarbage();
 }
 public function run(Message $message, Discord $discord, WebSocket $webSocket, Logger $log, &$audioStreams, Channel $channel, cURL $curl)
 {
     $guildID = $channel->guild_id;
     if (isset($audioStreams[$guildID])) {
         $audioStreams[$guildID]->unpause();
         $message->reply("Resuming audio playback..");
     }
 }
Example #5
0
 public function run(Message $message, Discord $discord, WebSocket $webSocket, Logger $log, &$audioStreams, Channel $channel, cURL $curl)
 {
     $guildID = $channel->guild_id;
     if (isset($audioStreams[$guildID])) {
         $audioStreams[$guildID]->stop();
         $message->reply("Skipping to the next song..");
     }
 }
Example #6
0
 public function run()
 {
     $this->message->reply("Memory in use before garbage collection: " . memory_get_usage() / 1024 / 1024 . "MB");
     gc_collect_cycles();
     $this->message->reply("Memory in use after garbage collection: " . memory_get_usage() / 1024 / 1024 . "MB");
     // Mark this as garbage
     $this->isGarbage();
 }
Example #7
0
 public function run()
 {
     $crestData = json_decode($this->curl->get("https://crest-tq.eveonline.com/"), true);
     $tqStatus = isset($crestData["serviceStatus"]["eve"]) ? $crestData["serviceStatus"]["eve"] : "offline";
     $tqOnline = (int) $crestData["userCounts"]["eve"];
     $msg = "**TQ Status:** {$tqStatus} with {$tqOnline} users online.";
     $this->message->reply($msg);
     // Mark this as garbage
     $this->isGarbage();
 }
Example #8
0
 public function run(Message $message, Discord $discord, WebSocket $webSocket, Logger $log, &$audioStreams, Channel $channel, cURL $curl)
 {
     $guildID = $channel->guild_id;
     if (isset($audioStreams[$guildID])) {
         // Kill the EVERadio FFMPEG stream if it's running
         if (isset($audioStreams["eveRadio"][$guildID])) {
             $audioStreams["eveRadio"][$guildID]->close();
         }
         $audioStreams[$guildID]->stop();
         $audioStreams[$guildID]->close();
         unset($audioStreams[$guildID]);
         $message->reply("Stopping audio playback..");
     }
 }
Example #9
0
 public function run()
 {
     $explode = explode(" ", $this->message->content);
     unset($explode[0]);
     $query = urlencode(implode(" ", $explode));
     $appID = urlencode($this->config->get("appID", "wolframalpha"));
     // WTB JSON endpoint...
     $data = json_decode(json_encode(new \SimpleXMLElement($this->curl->get("http://api.wolframalpha.com/v2/query?appid={$appID}&input={$query}"))), true);
     $result = $data["pod"][1]["subpod"];
     if (!empty($result)) {
         $image = $result["img"]["@attributes"]["src"];
         $text = $result["plaintext"];
         if (strlen($image) > 0) {
             $this->message->reply("{$text}\r\n {$image}");
             $wolfFileName = md5($query);
             file_put_contents(__DIR__ . "/../../../cache/image/{$wolfFileName}.gif", $image);
             $this->message->getChannelAttribute()->sendFile(__DIR__ . "/../../../cache/image/{$wolfFileName}.gif", "{$wolfFileName}.gif");
         } else {
             $this->message->reply("Result: {$image}");
         }
     } else {
         $this->message->reply("WolframAlpha did not have an answer to your query..");
     }
     // Mark this as garbage
     $this->isGarbage();
 }
Example #10
0
 public function run(Message $message, Discord $discord, WebSocket $webSocket, Logger $log, &$audioStreams, Channel $channel, cURL $curl)
 {
     $webSocket->joinVoiceChannel($channel)->then(function (VoiceClient $vc) use($message, $discord, $webSocket, $log, &$audioStreams, $channel) {
         $guildID = $message->getChannelAttribute()->guild_id;
         // Add this audio stream to the array of audio streams
         $audioStreams[$guildID] = $vc;
         $vc->setFrameSize(40)->then(function () use($vc, &$audioStreams, $guildID) {
             $vc->setBitrate(128000);
             $number = mt_rand(1, 6);
             $file = __DIR__ . "/../../../sounds/horns/{$number}.mp3";
             $vc->playFile($file, 2)->done(function () use($vc, &$audioStreams, $guildID) {
                 unset($audioStreams[$guildID]);
                 $vc->close();
             });
         });
     });
 }
Example #11
0
 public function run()
 {
     $explode = explode(" ", $this->message->content);
     $prefix = $this->channelConfig->prefix;
     $system = isset($explode[0]) ? $explode[0] == "{$prefix}pc" ? "global" : str_replace($prefix, "", $explode[0]) : "global";
     unset($explode[0]);
     $item = implode(" ", $explode);
     // Stuff that doesn't need a db lookup
     $quickLookUps = ["plex" => array("typeName" => "30 Day Pilot's License Extension (PLEX)", "typeID" => 29668), "injector" => array("typeName" => "Skill Injector", "typeID" => 40520), "extractor" => array("typeName" => "Skill Extractor", "typeID" => 40519)];
     if ($system && $item) {
         if (isset($quickLookUps[$item])) {
             $single = $quickLookUps[$item];
             $multiple = null;
         } else {
             $single = $this->db->queryRow("SELECT typeID, typeName FROM invTypes WHERE typeName = :item", array(":item" => $item));
             $multiple = $this->db->query("SELECT typeID, typeName FROM invTypes WHERE typeName LIKE :item LIMIT 5", array(":item" => $item));
         }
         if (count($multiple) == 1) {
             $single = $multiple[0];
         }
         if (empty($single) && !empty($multiple)) {
             $items = array();
             foreach ($multiple as $item) {
                 $items[] = $item["typeName"];
             }
             $items = implode(", ", $items);
             return $this->message->reply("**Multiple results found:** {$items}");
         }
         // If there is a single result, we'll get data now!
         if ($single) {
             $typeID = $single["typeID"];
             $typeName = $single["typeName"];
             if ($system == "global") {
                 $system = "global";
                 $data = new SimpleXMLElement($this->curl->get("https://api.eve-central.com/api/marketstat?typeid={$typeID}"));
             } else {
                 $solarSystemID = $this->db->queryField("SELECT solarSystemID FROM mapSolarSystems WHERE solarSystemName = :system", "solarSystemID", array(":system" => $system));
                 $data = new SimpleXMLElement($this->curl->get("https://api.eve-central.com/api/marketstat?usesystem={$solarSystemID}&typeid={$typeID}"));
             }
             $lowBuy = number_format((double) $data->marketstat->type->buy->min, 2);
             $avgBuy = number_format((double) $data->marketstat->type->buy->avg, 2);
             $highBuy = number_format((double) $data->marketstat->type->buy->max, 2);
             $lowSell = number_format((double) $data->marketstat->type->sell->min, 2);
             $avgSell = number_format((double) $data->marketstat->type->sell->avg, 2);
             $highSell = number_format((double) $data->marketstat->type->sell->max, 2);
             $solarSystemName = $system == "pc" ? "Global" : ucfirst($system);
             $messageData = "```\ntypeName: {$typeName}\nsolarSystemName: {$solarSystemName}\nBuy:\n  Low: {$lowBuy}\n  Avg: {$avgBuy}\n  High: {$highBuy}\nSell:\n  Low: {$lowSell}\n  Avg: {$avgSell}\n  High: {$highSell}```";
             $this->message->reply($messageData);
         } else {
             $this->message->reply("**Error:** ***{$item}*** not found");
         }
     } else {
         $this->message->reply("**Error:** No itemName set..");
     }
     // Mark this as garbage
     $this->isGarbage();
 }
Example #12
0
 public function run()
 {
     $time1 = new DateTime(date("Y-m-d H:i:s", $this->extras["startTime"]));
     $time2 = new DateTime(date("Y-m-d H:i:s"));
     $interval = $time1->diff($time2);
     $msg = "```I am the vanguard of your destruction. This exchange is just beginning...\n\nAuthor: Karbowiak (Discord ID: 118440839776174081)\nLibrary: DiscordPHP (https://github.com/teamreflex/DiscordPHP\\)\nCurrent Version: 0.0000000000\nGithub Repo: https://github.com/karbowiak/Sovereign\\\n\nStatistics:\nGuild/Server Count: {$this->extras["guildCount"]} (For specifics use {$this->channelConfig->prefix}guilds)\nMember Count: {$this->extras["memberCount"]}\nMemory Usage: ~" . round(memory_get_usage() / 1024 / 1024, 3) . "MB\nUptime: " . $interval->y . " Year(s), " . $interval->m . " Month(s), " . $interval->d . " Days, " . $interval->h . " Hours, " . $interval->i . " Minutes, " . $interval->s . " seconds.\n```";
     $this->message->reply($msg);
     // Mark this as garbage
     $this->isGarbage();
 }
Example #13
0
 public function run(Message $message, Discord $discord, WebSocket $webSocket, Logger $log, &$audioStreams, Channel $channel, cURL $curl)
 {
     $exp = explode(" ", $message->content);
     unset($exp[0]);
     $youtubeLink = implode(" ", $exp);
     // URL Checker
     $parts = parse_url($youtubeLink);
     if (!stristr($parts["host"], "youtube.com")) {
         return $message->reply("Error, you can only use youtube links!");
     }
     // Generate song md5
     $md5 = md5($youtubeLink);
     // Now get the mp3 from the cache
     $songFile = __DIR__ . "/../../../../../cache/songs/{$md5}.mp3";
     $dl = new YoutubeDl(["extract-audio" => true, "audio-format" => "mp3", "audio-quality" => 0, "output" => $songFile]);
     $title = "";
     try {
         $video = $dl->download($youtubeLink);
         $title = $video->getTitle();
         $log->addNotice("Downloading {$title} from YouTube");
     } catch (NotFoundException $e) {
         $log->addError("Error: the song was not found: {$e->getMessage()}");
         $message->reply("Error: the song was not found: {$e->getMessage()}");
     } catch (PrivateVideoException $e) {
         $log->addError("Error: song has been made private: {$e->getMessage()}");
         $message->reply("Error: song has been made private: {$e->getMessage()}");
     } catch (CopyrightException $e) {
         $log->addError("Error: song is under copyright: {$e->getMessage()}");
         $message->reply("Error: song is under copyright: {$e->getMessage()}");
     } catch (\Exception $e) {
         $log->addError("Error: {$e->getMessage()}");
         $message->reply("Error: {$e->getMessage()}");
     }
     $webSocket->joinVoiceChannel($channel)->then(function (VoiceClient $vc) use($message, $discord, $webSocket, $log, &$audioStreams, $channel, $curl, $songFile, $title) {
         $guildID = $message->getChannelAttribute()->guild_id;
         if (file_exists($songFile)) {
             // Add this audio stream to the array of audio streams
             $audioStreams[$guildID] = $vc;
             $vc->setFrameSize(40)->then(function () use($vc, &$audioStreams, $guildID, $songFile, $log, $message, $title, $channel) {
                 $vc->setBitrate(128000);
                 $message->reply("Now playing **{$title}** in {$channel->name}");
                 $vc->playFile($songFile, 2)->done(function () use($vc, &$audioStreams, $guildID) {
                     unset($audioStreams[$guildID]);
                     $vc->close();
                 });
             });
         }
     });
 }
Example #14
0
 public function run()
 {
     $explode = explode(" ", $this->message->content);
     $authString = isset($explode[1]) ? $explode[1] : "";
     if ($this->message->getChannelAttribute()->is_private) {
         return $this->message->reply("**Error** You are trying to send your auth token in private. This won't work because i need the guild information, which i can only get if you post it in a public channel on the server you want to get authed on.");
     }
     $authData = $this->db->queryRow("SELECT * FROM authRegs WHERE authString = :authString AND active = 1", array(":authString" => $authString));
     if ($authData) {
         $groups = json_decode($authData["groups"], true);
         $characterID = $authData["characterID"];
         /** @var Role $roles */
         $roles = $this->message->getFullChannelAttribute()->getGuildAttribute()->getRolesAttribute();
         /** @var Member $member */
         $member = $this->message->getFullChannelAttribute()->getGuildAttribute()->getMembersAttribute()->get("id", $this->message->author->id);
         $username = $this->message->author->username;
         $discordID = $this->message->author->id;
         // @todo Force ingame name
         $characterName = json_decode($this->curl->get("https://evedata.xyz/api/character/shortinformation/{$characterID}/"))->characterName;
         // Doesn't work yet, but it should be something like $member->nick($characterName);
         //$member->user->setAttribute("username", $characterName);
         /** @var Role $role */
         foreach ($roles as $role) {
             $roleName = $role->name;
             if (in_array($roleName, $groups)) {
                 $member->addRole($role);
             }
         }
         // Save the member object, so all the roles are set
         $member->save();
         $this->db->execute("UPDATE authRegs SET discordID = :discordID, active = 0 WHERE authString = :authString", array(":discordID" => $discordID, ":authString" => $authString));
         $this->log->addInfo("{$username} authenticated in {$this->message->getChannelAttribute()->name} on {$this->message->getChannelAttribute()->getGuildAttribute()->name}");
         $this->message->reply("You have now been added to the following groups: " . implode(", ", $groups));
     } else {
         $this->message->reply("**Error** You are trying to authenticate with an already used (or not existing) auth token..");
     }
     // Mark this as garbage
     $this->isGarbage();
 }
Example #15
0
 public function run()
 {
     $guilds = $this->discord->guilds->all();
     $list = "";
     /** @var Guild $guild */
     foreach ($guilds as $guild) {
         $guildID = $guild->getAttribute("id");
         $memberCount = $this->extras["guild"]["memberCount"]["id{$guildID}"];
         $list .= "{$guild->getAttribute("name")} ({$memberCount}) | ";
     }
     $this->message->reply("I am on the following servers: " . rtrim($list, ", "));
     // Mark this as garbage
     $this->isGarbage();
 }
Example #16
0
 public function run()
 {
     $pornConfig = @$this->channelConfig->p**n;
     // This is one of those plugins that need to be allowed before it works
     if (isset($pornConfig->allowedChannels) && in_array($this->message->channel_id, $pornConfig->allowedChannels)) {
         $explode = explode(" ", $this->message->content);
         unset($explode[0]);
         $type = implode(" ", $explode);
         $categoryNames = array();
         $url = "";
         $categories = array("redheads" => array("https://api.imgur.com/3/gallery/r/redheads/time/all/", "https://api.imgur.com/3/gallery/r/ginger/time/all/", "https://api.imgur.com/3/gallery/r/FireCrotch/time/all/"), "blondes" => "https://api.imgur.com/3/gallery/r/blondes/time/all/", "asians" => "https://api.imgur.com/3/gallery/r/AsiansGoneWild/time/all/", "gonewild" => "https://api.imgur.com/3/gallery/r/gonewild/time/all/", "realgirls" => "https://api.imgur.com/3/gallery/r/realgirls/time/all/", "palegirls" => "https://api.imgur.com/3/gallery/r/palegirls/time/all/", "gif" => "https://api.imgur.com/3/gallery/r/NSFW_GIF/time/all/", "lesbians" => "https://api.imgur.com/3/gallery/r/lesbians/time/all/", "tattoos" => "https://api.imgur.com/3/gallery/r/Hotchickswithtattoos/time/all/", "mgw" => "https://api.imgur.com/3/gallery/r/MilitaryGoneWild/time/all/", "amateur" => "https://api.imgur.com/3/gallery/r/AmateurArchives/time/all/", "college" => "https://api.imgur.com/3/gallery/r/collegesluts/time/all/", "bondage" => "https://api.imgur.com/3/gallery/r/bondage/time/all/", "milf" => "https://api.imgur.com/3/gallery/r/milf/time/all/", "freckles" => "https://api.imgur.com/3/gallery/r/FreckledGirls/time/all/", "cosplay" => "https://api.imgur.com/3/gallery/r/cosplay/time/all/", "t**s" => "https://api.imgur.com/3/gallery/r/boobs/time/all/", "ass" => "https://api.imgur.com/3/gallery/r/ass/time/all/", "food" => "https://api.imgur.com/3/gallery/r/foodporn/time/all/", "gifrecipes" => "https://api.imgur.com/3/gallery/r/gifrecipes/time/all/", "bbw" => "https://api.imgur.com/3/gallery/r/bbw/time/all/", "dongs" => "https://api.imgur.com/3/gallery/r/penis/time/all/", "innie" => "https://api.imgur.com/3/gallery/r/innie/time/all/");
         foreach ($categories as $catName => $catURL) {
             $categoryNames[] = ucfirst($catName);
             if (strtolower($type) == strtolower($catName)) {
                 if (is_array($catURL)) {
                     $url = $catURL[array_rand($catURL)];
                 } else {
                     $url = $catURL;
                 }
             }
         }
         if (!empty($url)) {
             // Select a random url
             $clientID = $this->config->get("clientID", "imgur");
             $headers = array();
             $headers[] = "Content-type: application/json";
             $headers[] = "Authorization: Client-ID {$clientID}";
             $data = $this->curl->get($url, $headers);
             if ($data) {
                 $json = json_decode($data, true)["data"];
                 $img = $json[array_rand($json)];
                 $imageURL = $img["link"];
                 // gifv doesn't embed properly in discord, yet..
                 $msg = "**Title:** {$img["title"]} | **Section:** {$img["section"]} | **url:** {$imageURL}";
                 $this->message->reply($msg);
             }
         } else {
             $msg = "No endpoint selected. Currently available are: " . implode(", ", $categoryNames);
             $this->message->reply($msg);
         }
     } else {
         $this->message->reply("Sorry, this plugin is not allowed in this channel, speak to your admin to get it allowed (To enable, use {$this->channelConfig->prefix}config enablePorn)");
     }
     // Mark this as garbage
     $this->isGarbage();
 }
Example #17
0
 public function run()
 {
     $explode = explode(" ", $this->message->content);
     unset($explode[0]);
     $name = implode(" ", $explode);
     $url = "https://evedata.xyz/api/search/corporation/" . urlencode($name) . "/";
     $data = @json_decode($this->curl->get($url), true)["corporation"];
     if (empty($data)) {
         return $this->message->reply("**Error:** no results was returned.");
     }
     if (count($data) > 1) {
         $results = array();
         foreach ($data as $corp) {
             $results[] = $corp["corporationName"];
         }
         return $this->message->reply("**Error:** more than one result was returned: " . implode(", ", $results));
     }
     // Get stats
     $corporationID = $data[0]["corporationID"];
     $statsURL = "https://beta.eve-kill.net/api/corpInfo/corporationID/" . urlencode($corporationID) . "/";
     $stats = json_decode($this->curl->get($statsURL), true);
     if (empty($stats)) {
         return $this->message->reply("**Error:** no data available");
     }
     $corporationName = @$stats["corporationName"];
     $allianceName = isset($stats["allianceName"]) ? $stats["allianceName"] : "None";
     $factionName = isset($stats["factionName"]) ? $stats["factionName"] : "None";
     $ceoName = @$stats["ceoName"];
     $homeStation = @$stats["stationName"];
     $taxRate = @$stats["taxRate"];
     $corporationActiveArea = @$stats["corporationActiveArea"];
     $allianceActiveArea = @$stats["allianceActiveArea"];
     $lifeTimeKills = @$stats["lifeTimeKills"];
     $lifeTimeLosses = @$stats["lifeTimeLosses"];
     $memberCount = @$stats["memberArrayCount"];
     $superCaps = @count($stats["superCaps"]);
     $ePeenSize = @$stats["ePeenSize"];
     $url = "https://beta.eve-kill.net/corporation/" . @$stats["corporationID"] . "/";
     $msg = "```corporationName: {$corporationName}\nallianceName: {$allianceName}\nfactionName: {$factionName}\nceoName: {$ceoName}\nhomeStation: {$homeStation}\ntaxRate: {$taxRate}\ncorporationActiveArea: {$corporationActiveArea}\nallianceActiveArea: {$allianceActiveArea}\nlifeTimeKills: {$lifeTimeKills}\nlifeTimeLosses: {$lifeTimeLosses}\nmemberCount: {$memberCount}\nsuperCaps: {$superCaps}\nePeenSize: {$ePeenSize}\n```\nFor more info, visit: {$url}";
     $this->message->reply($msg);
     // Mark this as garbage
     $this->isGarbage();
 }
Example #18
0
 public function run()
 {
     $explode = explode(" ", $this->message->content);
     unset($explode[0]);
     $item = implode(" ", $explode);
     if (is_numeric($item)) {
         $data = $this->db->queryRow("SELECT * FROM invTypes WHERE typeID = :typeID", array(":typeID" => $item));
     } else {
         $data = $this->db->queryRow("SELECT * FROM invTypes WHERE typeName = :typeName", array(":typeName" => $item));
     }
     if ($data) {
         $msg = "```";
         foreach ($data as $key => $value) {
             $msg .= $key . ": " . $value . "\n";
         }
         $msg .= "```";
         $this->message->reply($msg);
     }
     // Mark this as garbage
     $this->isGarbage();
 }
Example #19
0
 public function run()
 {
     $date = date("d-m-Y");
     $fullDate = date("Y-m-d H:i:s");
     $dateTime = new DateTime($fullDate);
     $et = $dateTime->setTimezone(new DateTimeZone("America/New_York"));
     $et = $et->format("H:i:s");
     $pt = $dateTime->setTimezone(new DateTimeZone("America/Los_Angeles"));
     $pt = $pt->format("H:i:s");
     $utc = $dateTime->setTimezone(new DateTimeZone("UTC"));
     $utc = $utc->format("H:i:s");
     $cet = $dateTime->setTimezone(new DateTimeZone("Europe/Copenhagen"));
     $cet = $cet->format("H:i:s");
     $msk = $dateTime->setTimezone(new DateTimeZone("Europe/Moscow"));
     $msk = $msk->format("H:i:s");
     $aest = $dateTime->setTimezone(new DateTimeZone("Australia/Sydney"));
     $aest = $aest->format("H:i:s");
     $msg = "**Current EVE Time:** {$utc} / **EVE Date:** {$date} / **Los Angeles (PT):** {$pt} / **New York (ET):** {$et} / **Berlin/Copenhagen (CET):** {$cet} / **Moscow (MSK):** {$msk} / **Sydney (AEST):** {$aest}";
     $this->message->reply($msg);
     // Mark this as garbage
     $this->isGarbage();
 }
Example #20
0
 /**
  *
  */
 public function run()
 {
     $explode = explode(" ", $this->message->content);
     $cmd = isset($explode[1]) ? $explode[1] : null;
     $plugins = (object) array_merge((array) $this->onMessagePlugins, (array) $this->onVoicePlugins);
     if (isset($cmd)) {
         foreach ($plugins as $command => $data) {
             if ($command == $cmd) {
                 if ($data["usage"]) {
                     $this->message->reply("**{$this->channelConfig->prefix}{$command}** _{$data["usage"]}_\r\n {$data["description"]}");
                 } else {
                     $this->message->reply("**{$this->channelConfig->prefix}{$command}** \r\n {$data["description"]}");
                 }
             }
         }
     } else {
         $msg = "**Commands:** \r\n";
         foreach ($plugins as $command => $data) {
             $msg .= "**{$this->channelConfig->prefix}{$command}** | ";
         }
         $this->message->reply($msg);
     }
 }
Example #21
0
 public function run()
 {
     $explode = explode(" ", $this->message->content);
     unset($explode[0]);
     $name = implode(" ", $explode);
     $name = stristr($name, "@") ? str_replace("<@", "", str_replace(">", "", $name)) : $name;
     if ($name) {
         $data = $this->db->queryRow("SELECT * FROM users WHERE (nickName = :name OR discordID = :name)", array(":name" => $name));
         if ($data) {
             // Is the person admin?
             $isAdmin = "no";
             foreach ($this->config->get("admins", "permissions") as $admins) {
                 $isAdmin = $admins == $data["discordID"] ? "yes" : "no";
             }
             $msg = "```ID: {$data["discordID"]}\nName: {$data["nickName"]}\nAdmin: {$isAdmin}\nLast Seen: {$data["lastSeen"]}\nLast Spoken: {$data["lastSpoke"]}\nLast Status: {$data["lastStatus"]}\nPlayed Last: {$data["game"]}```";
             $this->message->reply($msg);
         } else {
             $this->message->reply("Error, no such user has been seen..");
         }
     }
     // Mark this as garbage
     $this->isGarbage();
 }
Example #22
0
 public function run()
 {
     $guildID = $this->message->full_channel->guild->id;
     $input = explode(" ", $this->message->content);
     unset($input[0]);
     $type = isset($input[1]) ? $input[1] : "";
     unset($input[1]);
     // Defaults
     $channelID = $this->message->channel_id;
     $msg = "";
     // Config options
     switch (trim($type)) {
         case "setTrigger":
             $trigger = $input[2];
             $orgTrigger = $this->serverConfig->get($guildID, "prefix") ? $this->serverConfig->get($guildID, "prefix") : $this->channelConfig->prefix;
             $this->serverConfig->set($guildID, "prefix", $trigger);
             $msg = "Trigger has been changed from {$orgTrigger} to {$trigger}";
             break;
         case "enablePorn":
             $pornArray = $this->serverConfig->getAll($guildID)->p**n->allowedChannels;
             if (!in_array($channelID, $pornArray)) {
                 $pornArray[] = $channelID;
             }
             $this->serverConfig->set($guildID, "p**n", array("allowedChannels" => $pornArray));
             $msg = "P**n has now been enabled on this channel, enjoy, you perv ;)";
             break;
         case "disablePorn":
             $pornArray = $this->serverConfig->getAll($guildID)->p**n->allowedChannels;
             foreach ($pornArray as $key => $value) {
                 if ($value == $channelID) {
                     unset($pornArray[$key]);
                 }
             }
             $this->serverConfig->set($guildID, "p**n", array("allowedChannels" => $pornArray));
             $msg = "P**n has now been disabled on this channel. :(";
             break;
         case "addKillmails":
             // %config addKillmails character characterID
             $typeName = trim($input[2]);
             $typeID = trim($input[3]);
             switch ($typeName) {
                 case "character":
                     // Check said char exists on the killboard..
                     $exists = json_decode($this->curl->get("https://evedata.xyz/api/character/information/{$typeID}/"));
                     if (isset($exists->characterID)) {
                         $this->db->execute("INSERT IGNORE INTO killmailPosting (channelID, typeName, typeID) VALUES (:channelID, :typeName, :typeID)", array(":channelID" => $channelID, ":typeName" => $typeName, ":typeID" => $typeID));
                         $msg = "**Success** killmails should start getting posted for {$exists->characterName} to this channel";
                     } else {
                         $msg = "**Error** characterID is not valid";
                     }
                     break;
                 case "corporation":
                     // Check said char exists on the killboard..
                     $exists = json_decode($this->curl->get("https://evedata.xyz/api/corporation/information/{$typeID}/"));
                     if (isset($exists->corporationID)) {
                         $this->db->execute("INSERT IGNORE INTO killmailPosting (channelID, typeName, typeID) VALUES (:channelID, :typeName, :typeID)", array(":channelID" => $channelID, ":typeName" => $typeName, ":typeID" => $typeID));
                         $msg = "**Success** killmails should start getting posted for {$exists->corporationName} to this channel";
                     } else {
                         $msg = "**Error** corporationID is not valid";
                     }
                     break;
                 case "alliance":
                     // Check said char exists on the killboard..
                     $exists = json_decode($this->curl->get("https://evedata.xyz/api/alliance/information/{$typeID}/"));
                     if (isset($exists->allianceID)) {
                         $this->db->execute("INSERT IGNORE INTO killmailPosting (channelID, typeName, typeID) VALUES (:channelID, :typeName, :typeID)", array(":channelID" => $channelID, ":typeName" => $typeName, ":typeID" => $typeID));
                         $msg = "**Success** killmails should start getting posted for {$exists->allianceName} to this channel";
                     } else {
                         $msg = "**Error** allianceID is not valid";
                     }
                     break;
             }
             break;
         case "removeKillmails":
             break;
         case "listKillmails":
             break;
         case "addTwitterOauth":
             // Add oauth settings for twitter, and send twitter messages to the channel it was enabled in, unless channelID was passed along
             break;
         case "removeTwitterOauth":
             // Disable twitter, and remove the oauth keys
             break;
         case "addSiphonKey":
             // Add an apikey used for checking for siphons, output to the channel it was enabled in, unless a channelID was passed along
             break;
         case "removeSiphonKey":
             break;
         case "addMailKey":
             // same as add siphon
             break;
         case "removeMailKey":
             break;
         case "addNotificationKey":
             // same as add siphon
             break;
         case "removeNotificationKey":
             break;
         case "addAuth":
             // Enable authentication for a characterID, corporationID or allianceID - have multiple, and let them map 1:1 to groups on Discord (if group doesn't exist, create it)
             break;
         case "removeAuth":
             break;
         case "addJabberReader":
             // Setup a socket to listen for messages, make them prepend a key for the channel it was enabled in (unless a channelID was specified)
             break;
         case "removeJabberReader":
             break;
         default:
             $msg = "Error, no configuration option picked. Available configuration options are: setTrigger, enablePorn, disablePorn, addTwitterOauth, removeTwitterOauth, addSiphonKey, removeSiphonKey, addMailKey, removeMailKey, addNotificationKey, removeNotificationKey, addJabberReader, removeJabberReader, addAuth, removeAuth";
             break;
     }
     $this->message->reply($msg);
     // Mark this as garbage
     $this->isGarbage();
 }
Example #23
0
 public function run()
 {
     $this->message->reply("Sorry, joining a server does not work - instead use the following link: https://discordapp.com/oauth2/authorize?client_id=176115483513323520&scope=bot&permissions=36703232");
     // Mark this as garbage
     $this->isGarbage();
 }
Example #24
0
 public function run()
 {
     // Most EVE players on Discord use their ingame name, so lets support @highlights
     $explode = explode(" ", $this->message->content);
     unset($explode[0]);
     $name = implode(" ", $explode);
     $name = stristr($name, "@") ? str_replace("<@", "", str_replace(">", "", $name)) : $name;
     if (is_numeric($name)) {
         // The person used @highlighting, so now we got a discord id, lets map that to a name
         $name = $this->db->queryField("SELECT nickName FROM users WHERE discordID = :id", "nickName", array(":id" => $name));
     }
     $url = "https://evedata.xyz/api/search/character/" . urlencode($name) . "/";
     $data = @json_decode($this->curl->get($url), true)["character"];
     if (empty($data)) {
         return $this->message->reply("**Error:** no results was returned.");
     }
     $exists = false;
     if (count($data) > 1) {
         $results = array();
         foreach ($data as $char) {
             if (strtolower($char["characterName"]) == strtolower($name)) {
                 $data[0]["characterID"] = $char["characterID"];
                 $exists = true;
             }
             $results[] = $char["characterName"];
         }
         if ($exists == false) {
             return $this->message->reply("**Error:** more than one result was returned: " . implode(", ", $results));
         }
     }
     // Get stats
     $characterID = $data[0]["characterID"];
     $statsURL = "https://beta.eve-kill.net/api/charInfo/characterID/" . urlencode($characterID) . "/";
     $stats = json_decode($this->curl->get($statsURL), true);
     if (empty($stats)) {
         return $this->message->reply("**Error:** no data available");
     }
     $characterName = @$stats["characterName"];
     $corporationName = @$stats["corporationName"];
     $allianceName = isset($stats["allianceName"]) ? $stats["allianceName"] : "None";
     $factionName = isset($stats["factionName"]) ? $stats["factionName"] : "None";
     $securityStatus = @$stats["securityStatus"];
     $lastSeenSystem = @$stats["lastSeenSystem"];
     $lastSeenRegion = @$stats["lastSeenRegion"];
     $lastSeenShip = @$stats["lastSeenShip"];
     $lastSeenDate = @$stats["lastSeenDate"];
     $corporationActiveArea = @$stats["corporationActiveArea"];
     $allianceActiveArea = @$stats["allianceActiveArea"];
     $soloKills = @$stats["soloKills"];
     $blobKills = @$stats["blobKills"];
     $lifeTimeKills = @$stats["lifeTimeKills"];
     $lifeTimeLosses = @$stats["lifeTimeLosses"];
     $amountOfSoloPVPer = @$stats["percentageSoloPVPer"];
     $ePeenSize = @$stats["ePeenSize"];
     $facepalms = @$stats["facepalms"];
     $lastUpdated = @$stats["lastUpdatedOnBackend"];
     $url = "https://beta.eve-kill.net/character/" . $stats["characterID"] . "/";
     $msg = "```characterName: {$characterName}\ncorporationName: {$corporationName}\nallianceName: {$allianceName}\nfactionName: {$factionName}\nsecurityStatus: {$securityStatus}\nlastSeenSystem: {$lastSeenSystem}\nlastSeenRegion: {$lastSeenRegion}\nlastSeenShip: {$lastSeenShip}\nlastSeenDate: {$lastSeenDate}\ncorporationActiveArea: {$corporationActiveArea}\nallianceActiveArea: {$allianceActiveArea}\nsoloKills: {$soloKills}\nblobKills: {$blobKills}\nlifeTimeKills: {$lifeTimeKills}\nlifeTimeLosses: {$lifeTimeLosses}\npercentageSoloPVPer: {$amountOfSoloPVPer}\nePeenSize: {$ePeenSize}\nfacepalms: {$facepalms}\nlastUpdated: {$lastUpdated}```\nFor more info, visit: {$url}";
     $this->message->reply($msg);
     // Mark this as garbage
     $this->isGarbage();
 }
Example #25
-1
 /**
  *
  */
 public function run()
 {
     $guildID = $this->message->getFullChannelAttribute()->guild_id;
     $cleverBotNick = $this->db->queryField("SELECT nick FROM cleverbot WHERE serverID = :serverID", "nick", array(":serverID" => $guildID));
     // Simply remove the <id> part of the string, since it seems to make the responses from Cleverbot be less idiotic and terrible..
     $msg = str_replace("<@{$this->discord->getClient()->id}>", "", $this->message->content);
     $response = $this->curl->post("https://cleverbot.io/1.0/ask", array("user" => $this->config->get("user", "cleverbot"), "key" => $this->config->get("key", "cleverbot"), "nick" => $cleverBotNick, "text" => $msg));
     if ($response) {
         $resp = @json_decode($response);
         $reply = isset($resp->response) ? $resp->response : false;
         if ($reply) {
             $this->message->getChannelAttribute()->broadcastTyping();
             $this->message->reply($reply);
         }
     }
 }