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 55 Coin,
66 Commands,
77 Cron,
8+ Everyone,
89 Links,
910 Lyric,
1011 Report,
@@ -18,6 +19,7 @@ const alice = new Alice([
1819 new Coin ( ) ,
1920 new Commands ( ) ,
2021 new Cron ( ) ,
22+ new Everyone ( ) ,
2123 new Links ( ) ,
2224 new Lyric ( ) ,
2325 new Report ( ) ,
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ Os seguintes comandos estão disponiveis:
1414- !coin
1515- !commands
1616- !cron
17+ - !everyone
1718- !links
1819- !lyric
1920- !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 = {
55 Coin : require ( './coin' ) ,
66 Commands : require ( './commands' ) ,
77 Cron : require ( './cron' ) ,
8+ Everyone : require ( './everyone' ) ,
89 Links : require ( './links' ) ,
910 Lyric : require ( './lyric' ) ,
1011 Report : require ( './report' ) ,
You can’t perform that action at this time.
0 commit comments