File tree Expand file tree Collapse file tree 4 files changed +55
-0
lines changed Expand file tree Collapse file tree 4 files changed +55
-0
lines changed Original file line number Diff line number Diff line change 5
5
Coin,
6
6
Commands,
7
7
Cron,
8
+ Everyone,
8
9
Links,
9
10
Lyric,
10
11
Report,
@@ -18,6 +19,7 @@ const alice = new Alice([
18
19
new Coin ( ) ,
19
20
new Commands ( ) ,
20
21
new Cron ( ) ,
22
+ new Everyone ( ) ,
21
23
new Links ( ) ,
22
24
new Lyric ( ) ,
23
25
new Report ( ) ,
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ Os seguintes comandos estão disponiveis:
14
14
- !coin
15
15
- !commands
16
16
- !cron
17
+ - !everyone
17
18
- !links
18
19
- !lyric
19
20
- !report
Original file line number Diff line number Diff line change
1
+ const { chattools } = require ( '../utils' ) ;
2
+
3
+ const STRINGS = {
4
+ help : `
5
+ Marca todos os membros do grupo com a mensagem citada.
6
+
7
+ *uso:* \`\`\`!everyone [--args]\`\`\`
8
+
9
+ *args válidos:*
10
+ \`\`\`--help\`\`\` -> _mostra esta mensagem._
11
+ ` . trim ( ) ,
12
+ defaultMessage : '@everyone' ,
13
+ } ;
14
+
15
+ class Everyone {
16
+ constructor ( ) {
17
+ this . name = 'everyone' ;
18
+ this . strings = STRINGS ;
19
+ }
20
+
21
+ async execute ( data , message ) {
22
+ const { args } = data ;
23
+ const isAdm = await chattools . isAdm ( message ) ;
24
+
25
+ if ( ! isAdm ) {
26
+ message . reply ( 'staff only.' ) ;
27
+ return ;
28
+ }
29
+
30
+ if ( args . includes ( 'help' ) ) {
31
+ message . reply ( this . strings . help ) ;
32
+ return ;
33
+ }
34
+
35
+ const chat = await message . getChat ( ) ;
36
+ const { participants } = chat ;
37
+
38
+ if ( message . hasQuotedMsg ) {
39
+ const quotedMessage = await message . getQuotedMessage ( ) ;
40
+
41
+ quotedMessage . reply ( this . strings . defaultMessage , undefined , {
42
+ mentions : participants ,
43
+ } ) ;
44
+ return ;
45
+ }
46
+
47
+ throw new Error ( 'No message was replied.' ) ;
48
+ }
49
+ }
50
+
51
+ module . exports = Everyone ;
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ module.exports = {
5
5
Coin : require ( './coin' ) ,
6
6
Commands : require ( './commands' ) ,
7
7
Cron : require ( './cron' ) ,
8
+ Everyone : require ( './everyone' ) ,
8
9
Links : require ( './links' ) ,
9
10
Lyric : require ( './lyric' ) ,
10
11
Report : require ( './report' ) ,
You can’t perform that action at this time.
0 commit comments