Skip to content

Commit

Permalink
Add license
Browse files Browse the repository at this point in the history
  • Loading branch information
valzargaming committed Sep 17, 2021
1 parent 502cf1e commit cb68a1e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 20 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "vzgcoders/palace",
"description": "ValZarGaming's offical Discord bot for moderation and fun built in ReactPHP.",
"license": "MIT",
"authors": [
{
"name": "Valithor Obsidion",
Expand Down
29 changes: 9 additions & 20 deletions disconnect-include.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,21 @@

switch ($code) {
case '4004':
if(isset($GLOBALS['debug_echo']) && $GLOBALS['debug_echo']) echo "[CRITICAL] TOKEN INVALIDATED BY DISCORD!" . PHP_EOL;
//Use Restcord to send a message
$guild = $restcord->guild->getGuild(['guild.id' => 116927365652807686]);
try {
$restcord->channel->createMessage([
'channel.id' => 315259546308444160,
'content' => '<@116927250145869826> token invalidated!',
]);
} catch (GuzzleHttp\Command\Exception\CommandClientException $e) {
var_dump($e->getResponse()->getBody()->getContents());
}
echo "[CRITICAL] TOKEN INVALIDATED BY DISCORD!" . PHP_EOL;
//Kill the bot
$loop->stop();
$discord->destroy();
return true;
default:
$discord->destroy();
}

$discord->destroy();
if ($vm == true) {
switch ($code) {
case '1000':
case '4003':
//case '4004':
$loop->stop();
$loop = \React\EventLoop\Factory::create(); //Recreate loop if the cause of the disconnect was possibly related to a VM being paused
}
case '1000':
case '4003':
//case '4004':
$loop->stop();
$loop = \React\EventLoop\Factory::create(); //Recreate loop if the cause of the disconnect was possibly related to a VM being paused
}
}
$discord = new \CharlotteDunois\Yasmin\Client(array(), $loop); //Create a new client using the same React loop

Expand Down

0 comments on commit cb68a1e

Please sign in to comment.