|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Sovereign\Plugins\onMessage; |
|
4
|
|
|
|
|
5
|
|
|
use Discord\Discord; |
|
6
|
|
|
use Discord\Parts\Channel\Message; |
|
7
|
|
|
use Monolog\Logger; |
|
8
|
|
|
use Sovereign\Lib\Config; |
|
|
|
|
|
|
9
|
|
|
use Sovereign\Lib\cURL; |
|
10
|
|
|
use Sovereign\Lib\Db; |
|
11
|
|
|
use Sovereign\Lib\Permissions; |
|
12
|
|
|
use Sovereign\Lib\ServerConfig; |
|
13
|
|
|
use Sovereign\Lib\Settings; |
|
14
|
|
|
use Sovereign\Lib\Users; |
|
15
|
|
|
|
|
16
|
|
|
class meme extends \Threaded implements \Collectable |
|
17
|
|
|
{ |
|
18
|
|
|
/** |
|
19
|
|
|
* @var Message |
|
20
|
|
|
*/ |
|
21
|
|
|
private $message; |
|
22
|
|
|
/** |
|
23
|
|
|
* @var Discord |
|
24
|
|
|
*/ |
|
25
|
|
|
private $discord; |
|
26
|
|
|
/** |
|
27
|
|
|
* @var Logger |
|
28
|
|
|
*/ |
|
29
|
|
|
private $log; |
|
30
|
|
|
/** |
|
31
|
|
|
* @var array |
|
32
|
|
|
*/ |
|
33
|
|
|
private $channelConfig; |
|
34
|
|
|
/** |
|
35
|
|
|
* @var Config |
|
36
|
|
|
*/ |
|
37
|
|
|
private $config; |
|
38
|
|
|
/** |
|
39
|
|
|
* @var Db |
|
40
|
|
|
*/ |
|
41
|
|
|
private $db; |
|
42
|
|
|
/** |
|
43
|
|
|
* @var cURL |
|
44
|
|
|
*/ |
|
45
|
|
|
private $curl; |
|
46
|
|
|
/** |
|
47
|
|
|
* @var Settings |
|
48
|
|
|
*/ |
|
49
|
|
|
private $settings; |
|
50
|
|
|
/** |
|
51
|
|
|
* @var Permissions |
|
52
|
|
|
*/ |
|
53
|
|
|
private $permissions; |
|
54
|
|
|
/** |
|
55
|
|
|
* @var ServerConfig |
|
56
|
|
|
*/ |
|
57
|
|
|
private $serverConfig; |
|
58
|
|
|
/** |
|
59
|
|
|
* @var Users |
|
60
|
|
|
*/ |
|
61
|
|
|
private $users; |
|
62
|
|
|
/** |
|
63
|
|
|
* @var array |
|
64
|
|
|
*/ |
|
65
|
|
|
private $extras; |
|
66
|
|
|
|
|
67
|
|
View Code Duplication |
public function __construct($message, $discord, $channelConfig, $log, $config, $db, $curl, $settings, $permissions, $serverConfig, $users, $extras) |
|
|
|
|
|
|
68
|
|
|
{ |
|
69
|
|
|
$this->message = $message; |
|
70
|
|
|
$this->discord = $discord; |
|
71
|
|
|
$this->channelConfig = $channelConfig; |
|
72
|
|
|
$this->log = $log; |
|
73
|
|
|
$this->config = $config; |
|
74
|
|
|
$this->db = $db; |
|
75
|
|
|
$this->curl = $curl; |
|
76
|
|
|
$this->settings = $settings; |
|
77
|
|
|
$this->permissions = $permissions; |
|
78
|
|
|
$this->serverConfig = $serverConfig; |
|
79
|
|
|
$this->users = $users; |
|
80
|
|
|
$this->extras = $extras; |
|
81
|
|
|
} |
|
82
|
|
|
|
|
83
|
|
|
public function run() |
|
84
|
|
|
{ |
|
85
|
|
|
$memes = array( |
|
86
|
|
|
'dank meme', |
|
87
|
|
|
'>mfw no gf', |
|
88
|
|
|
"m'lady *tip*", |
|
89
|
|
|
'le toucan has arrived', |
|
90
|
|
|
"jet juel can't melt dank memes", |
|
91
|
|
|
'༼ つ ◕_◕ ༽つ gibe', |
|
92
|
|
|
'ヽ༼ຈل͜ຈ༽ノ raise your dongers ヽ༼ຈل͜ຈ༽ノ', |
|
93
|
|
|
'ヽʕ •ᴥ•ʔノ raise your koalas ヽʕ •ᴥ•ʔノ', |
|
94
|
|
|
'ಠ_ಠ', |
|
95
|
|
|
'(-‸ლ)', |
|
96
|
|
|
'( ͡° ͜ʖ ͡°)', |
|
97
|
|
|
'( ° ͜ʖ͡°)╭∩╮', |
|
98
|
|
|
'(╯°□°)╯︵ ┻━┻', |
|
99
|
|
|
'┬──┬ ノ( ゜-゜ノ)', |
|
100
|
|
|
'•_•) ( •_•)>⌐■-■ (⌐■_■)', |
|
101
|
|
|
"i dunno lol ¯\\(°_o)/¯", |
|
102
|
|
|
"how do i shot web ¯\\(°_o)/¯", |
|
103
|
|
|
'(◕‿◕✿)', |
|
104
|
|
|
'ヾ(〃^∇^)ノ', |
|
105
|
|
|
'\( ̄▽ ̄)/', |
|
106
|
|
|
'(ノ◕ヮ◕)ノ*:・゚✧', |
|
107
|
|
|
'ᕕ( ͡° ͜ʖ ͡°)ᕗ', |
|
108
|
|
|
'ᕕ( ᐛ )ᕗ ᕕ( ᐛ )ᕗ ᕕ( ᐛ )ᕗ', |
|
109
|
|
|
"(ノ◕ヮ◕)ノ *:・゚✧ SO KAWAII ✧・:* \\(◕ヮ◕\\)", |
|
110
|
|
|
'ᕙ༼ຈل͜ຈ༽ᕗ. ʜᴀʀᴅᴇʀ, ʙᴇᴛᴛᴇʀ, ғᴀsᴛᴇʀ, ᴅᴏɴɢᴇʀ .ᕙ༼ຈل͜ຈ༽ᕗ', |
|
111
|
|
|
"(∩ ͡° ͜ʖ ͡°)⊃━☆゚. * ・ 。゚you've been touched by the donger fairy", |
|
112
|
|
|
'(ง ͠° ͟ل͜ ͡°)ง ᴍᴀsᴛᴇʀ ʏᴏᴜʀ ᴅᴏɴɢᴇʀ, ᴍᴀsᴛᴇʀ ᴛʜᴇ ᴇɴᴇᴍʏ (ง ͠° ͟ل͜ ͡°)ง', |
|
113
|
|
|
"(⌐■_■)=/̵͇̿̿/'̿'̿̿̿ ̿ ̿̿ ヽ༼ຈل͜ຈ༽ノ keep your dongers where i can see them", |
|
114
|
|
|
'[̲̅$̲̅(̲̅ ͡° ͜ʖ ͡°̲̅)̲̅$̲̅] do you have change for a donger bill [̲̅$̲̅(̲̅ ͡° ͜ʖ ͡°̲̅)̲̅$̲̅]', |
|
115
|
|
|
'╰( ͡° ͜ʖ ͡° )つ──☆*:・゚ clickty clack clickty clack with this chant I summon spam to the chat', |
|
116
|
|
|
'work it ᕙ༼ຈل͜ຈ༽ᕗ harder make it (ง •̀_•́)ง better do it ᕦ༼ຈل͜ຈ༽ᕤ faster raise ur ヽ༼ຈل͜ຈ༽ノ donger', |
|
117
|
|
|
); |
|
118
|
|
|
$this->message->reply($memes[array_rand($memes)]); |
|
119
|
|
|
|
|
120
|
|
|
// Mark this as garbage |
|
121
|
|
|
$this->isGarbage(); |
|
122
|
|
|
} |
|
123
|
|
|
} |
Let’s assume that you have a directory layout like this:
. |-- OtherDir | |-- Bar.php | `-- Foo.php `-- SomeDir `-- Foo.phpand let’s assume the following content of
Bar.php:If both files
OtherDir/Foo.phpandSomeDir/Foo.phpare loaded in the same runtime, you will see a PHP error such as the following:PHP Fatal error: Cannot use SomeDir\Foo as Foo because the name is already in use in OtherDir/Foo.phpHowever, as
OtherDir/Foo.phpdoes not necessarily have to be loaded and the error is only triggered if it is loaded beforeOtherDir/Bar.php, this problem might go unnoticed for a while. In order to prevent this error from surfacing, you must import the namespace with a different alias: