src/Plugins/onMessage/eightball.php
<?php
namespace Sovereign\Plugins\onMessage;
use Discord\Discord;
use Discord\Parts\Channel\Message;
use Monolog\Logger;
use Sovereign\Lib\Config;
use Sovereign\Lib\cURL;
use Sovereign\Lib\Db;
use Sovereign\Lib\Permissions;
use Sovereign\Lib\ServerConfig;
use Sovereign\Lib\Settings;
use Sovereign\Lib\Users;
class eightball extends \Threaded implements \Collectable
{
/**
* @var Message
*/
private $message;
/**
* @var Discord
*/
private $discord;
/**
* @var Logger
*/
private $log;
/**
* @var array
*/
private $channelConfig;
/**
* @var Config
*/
private $config;
/**
* @var Db
*/
private $db;
/**
* @var cURL
*/
private $curl;
/**
* @var Settings
*/
private $settings;
/**
* @var Permissions
*/
private $permissions;
/**
* @var ServerConfig
*/
private $serverConfig;
/**
* @var Users
*/
private $users;
/**
* @var array
*/
private $extras;
public function __construct($message, $discord, $channelConfig, $log, $config, $db, $curl, $settings, $permissions, $serverConfig, $users, $extras)
{
$this->message = $message;
$this->discord = $discord;
$this->channelConfig = $channelConfig;
$this->log = $log;
$this->config = $config;
$this->db = $db;
$this->curl = $curl;
$this->settings = $settings;
$this->permissions = $permissions;
$this->serverConfig = $serverConfig;
$this->users = $users;
$this->extras = $extras;
}
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();
}
}