File tree 9 files changed +43
-73
lines changed
9 files changed +43
-73
lines changed Original file line number Diff line number Diff line change @@ -20,19 +20,6 @@ module.exports = class AddCommand extends Command {
20
20
flag : [ '--reverse' , '-r' ] ,
21
21
} ,
22
22
] ,
23
- options : {
24
- help : {
25
- examples : [
26
- ':emojiName:' ,
27
- 'EmojiName :emojiName:' ,
28
- ':emojiName: EmojiName' ,
29
- 'EmojiName https://i.imgur.com/8jGJzmd.png' ,
30
- 'https://i.imgur.com/8jGJzmd.png EmojiName' ,
31
- 'EmojiName https://i.imgur.com/8jGJzmd.png --reverse' ,
32
- 'EmojiName (supply only a name with an image attachment)' ,
33
- ] ,
34
- } ,
35
- } ,
36
23
} )
37
24
}
38
25
Original file line number Diff line number Diff line change @@ -16,15 +16,6 @@ module.exports = class ApproveCommand extends Command {
16
16
'default' : 'emoji' ,
17
17
} ,
18
18
] ,
19
- options : {
20
- help : {
21
- examples : [
22
- 'EmojiName (if `--mode=x` argument is omitted, defaults to `emoji`)' ,
23
- 'EmojiName --mode=emoji (approves a pending emoji poll)' ,
24
- 'EmojiName --mode=rename (approves a pending rename poll)' ,
25
- ] ,
26
- } ,
27
- } ,
28
19
} )
29
20
}
30
21
Original file line number Diff line number Diff line change
1
+ module . exports = {
2
+ add : [
3
+ ':emojiName:' ,
4
+ 'EmojiName :emojiName:' ,
5
+ ':emojiName: EmojiName' ,
6
+ 'EmojiName https: //i.imgur.com/8jGJzmd.png' ,
7
+ 'https: //i.imgur.com/8jGJzmd.png EmojiName' ,
8
+ 'EmojiName https: //i.imgur.com/8jGJzmd.png --reverse' ,
9
+ 'EmojiName (supply only a name with an image attachment)' ,
10
+ ] ,
11
+ approve : [
12
+ 'EmojiName (if `--mode=x` argument is omitted, defaults to `emoji`)' ,
13
+ 'EmojiName --mode=emoji (approves a pending emoji poll)' ,
14
+ 'EmojiName --mode=rename (approves a pending rename poll)' ,
15
+ ] ,
16
+ deny : [
17
+ 'EmojiName (if `--mode=x` argument is omitted, defaults to `emoji`)' ,
18
+ 'EmojiName --mode=emoji (approves a pending emoji poll)' ,
19
+ 'EmojiName --mode=rename (approves a pending rename poll)' ,
20
+ ] ,
21
+ 'emoji-search' : [ 'EmojiName' , ':emoji:' ] ,
22
+ help : [ '' , 'add' ] ,
23
+ rename : [
24
+ 'oldName newName (if `--mode=x` argument is omitted, defaults to `emoji`)' ,
25
+ 'oldName newName --mode=poll (renames a pending poll you\'ve made)' ,
26
+ ':oldEmoji: newName' ,
27
+ 'newName :oldEmoji:' ,
28
+ ] ,
29
+ server : [ '1' ] ,
30
+ sync : [
31
+ 'all' ,
32
+ 'invites' ,
33
+ 'info 2 (`1` is invalid)' ,
34
+ 'galleries' ,
35
+ 'gallery 2' ,
36
+ 'status' ,
37
+ ] ,
38
+ }
Original file line number Diff line number Diff line change @@ -15,15 +15,6 @@ module.exports = class DenyCommand extends Command {
15
15
'default' : 'emoji' ,
16
16
} ,
17
17
] ,
18
- options : {
19
- help : {
20
- examples : [
21
- 'EmojiName (if `--mode=x` argument is omitted, defaults to `emoji`)' ,
22
- 'EmojiName --mode=emoji (approves a pending emoji poll)' ,
23
- 'EmojiName --mode=rename (approves a pending rename poll)' ,
24
- ] ,
25
- } ,
26
- } ,
27
18
} )
28
19
}
29
20
Original file line number Diff line number Diff line change @@ -17,11 +17,6 @@ module.exports = class EmojiSearchCommand extends Command {
17
17
} ,
18
18
} ,
19
19
] ,
20
- options : {
21
- help : {
22
- examples : [ 'EmojiName' , ':emoji:' ] ,
23
- } ,
24
- } ,
25
20
} )
26
21
}
27
22
Original file line number Diff line number Diff line change 1
1
const { MessageEmbed } = require ( 'discord.js' )
2
2
const { Command } = require ( 'discord-akairo' )
3
3
const { colors } = require ( '../config.js' )
4
+ const examples = require ( './data/examples.js' )
4
5
const textUtil = require ( '../util/text.js' )
5
6
const permissionsUtil = require ( '../util/permissions.js' )
6
7
@@ -26,11 +27,6 @@ module.exports = class HelpCommand extends Command {
26
27
} ,
27
28
} ,
28
29
] ,
29
- options : {
30
- help : {
31
- examples : [ '' , 'add' ] ,
32
- } ,
33
- } ,
34
30
} )
35
31
}
36
32
@@ -60,12 +56,11 @@ module.exports = class HelpCommand extends Command {
60
56
embed . addField ( 'User permissions needed' , permissionsUtil . formatNames ( command . userPermissions ) , true )
61
57
}
62
58
63
- // NOTE: `Command.options` has been removed; need to approach this differently
64
- // const { help: helpData = {} } = command.options;
59
+ const { [ command ] : commandExamples } = examples
65
60
66
- // if (helpData.examples && helpData.examples .length) {
67
- // embed.addField('Examples', helpData.examples. map(example => `${prefix}${command.id} ${example}`).join('\n'));
68
- // }
61
+ if ( commandExamples && commandExamples . length ) {
62
+ embed . addField ( 'Examples' , commandExamples . map ( example => `${ prefix } ${ command . id } ${ example } ` ) . join ( '\n' ) )
63
+ }
69
64
70
65
return message . util . send ( embed )
71
66
}
Original file line number Diff line number Diff line change @@ -25,16 +25,6 @@ module.exports = class RenameCommand extends Command {
25
25
match : 'rest' ,
26
26
} ,
27
27
] ,
28
- options : {
29
- help : {
30
- examples : [
31
- 'oldName newName (if `--mode=x` argument is omitted, defaults to `emoji`)' ,
32
- 'oldName newName --mode=poll (renames a pending poll you\'ve made)' ,
33
- ':oldEmoji: newName' ,
34
- 'newName :oldEmoji:' ,
35
- ] ,
36
- } ,
37
- } ,
38
28
} )
39
29
}
40
30
Original file line number Diff line number Diff line change @@ -17,11 +17,6 @@ module.exports = class ServerCommand extends Command {
17
17
} ,
18
18
} ,
19
19
] ,
20
- options : {
21
- help : {
22
- examples : [ '1' ] ,
23
- } ,
24
- } ,
25
20
} )
26
21
}
27
22
Original file line number Diff line number Diff line change @@ -32,18 +32,6 @@ module.exports = class SyncCommand extends Command {
32
32
flag : [ '--force' , '-f' ] ,
33
33
} ,
34
34
] ,
35
- options : {
36
- help : {
37
- examples : [
38
- 'all' ,
39
- 'invites' ,
40
- 'info 2 (`1` is invalid)' ,
41
- 'galleries' ,
42
- 'gallery 2' ,
43
- 'status' ,
44
- ] ,
45
- } ,
46
- } ,
47
35
} )
48
36
}
49
37
You can’t perform that action at this time.
0 commit comments