|
1 |
| -import { Interaction } from 'detritus-client'; |
2 |
| - |
3 |
| -import { Formatter, Parameters, editOrReply } from '../../../../utils'; |
4 |
| - |
5 |
| -import { BaseInteractionCommandOption } from '../../basecommand'; |
6 |
| - |
7 |
| - |
8 |
| -export class TagRemoveCommand extends BaseInteractionCommandOption { |
9 |
| - description = 'Remove a tag'; |
10 |
| - metadata = { |
11 |
| - id: Formatter.Commands.TagRemove.COMMAND_ID, |
12 |
| - }; |
13 |
| - name = 'remove'; |
14 |
| - |
15 |
| - constructor() { |
16 |
| - super({ |
17 |
| - options: [ |
18 |
| - { |
19 |
| - name: 'name', |
20 |
| - description: 'Tag\'s Name', |
21 |
| - label: 'tag', |
22 |
| - required: true, |
23 |
| - value: Parameters.NotSoTag, |
24 |
| - onAutoComplete: Parameters.AutoComplete.tags, |
25 |
| - }, |
26 |
| - ], |
27 |
| - }); |
28 |
| - } |
29 |
| - |
30 |
| - onBeforeRun(context: Interaction.InteractionContext, args: Formatter.Commands.TagRemove.CommandArgsBefore) { |
31 |
| - return !!args.tag; |
32 |
| - } |
33 |
| - |
34 |
| - onCancelRun(context: Interaction.InteractionContext, args: Formatter.Commands.TagRemove.CommandArgsBefore) { |
35 |
| - if (args.tag === false) { |
36 |
| - return editOrReply(context, '⚠ Unknown Tag'); |
37 |
| - } |
38 |
| - return super.onCancelRun(context, args); |
39 |
| - } |
40 |
| - |
41 |
| - async run(context: Interaction.InteractionContext, args: Formatter.Commands.TagRemove.CommandArgs) { |
42 |
| - return Formatter.Commands.TagRemove.createMessage(context, args); |
43 |
| - } |
44 |
| -} |
| 1 | +import { Interaction } from 'detritus-client'; |
| 2 | + |
| 3 | +import { Formatter, Parameters, editOrReply } from '../../../../utils'; |
| 4 | + |
| 5 | +import { BaseInteractionCommandOption } from '../../basecommand'; |
| 6 | + |
| 7 | + |
| 8 | +export class TagRemoveCommand extends BaseInteractionCommandOption { |
| 9 | + description = 'Remove a tag'; |
| 10 | + metadata = { |
| 11 | + id: Formatter.Commands.TagRemove.COMMAND_ID, |
| 12 | + }; |
| 13 | + name = 'remove'; |
| 14 | + |
| 15 | + constructor() { |
| 16 | + super({ |
| 17 | + options: [ |
| 18 | + { |
| 19 | + name: 'name', |
| 20 | + description: 'Tag\'s Name', |
| 21 | + label: 'tag', |
| 22 | + required: true, |
| 23 | + value: Parameters.NotSoTag, |
| 24 | + onAutoComplete: Parameters.AutoComplete.tags, |
| 25 | + }, |
| 26 | + ], |
| 27 | + }); |
| 28 | + } |
| 29 | + |
| 30 | + onBeforeRun(context: Interaction.InteractionContext, args: Formatter.Commands.TagRemove.CommandArgsBefore) { |
| 31 | + return !!args.tag; |
| 32 | + } |
| 33 | + |
| 34 | + onCancelRun(context: Interaction.InteractionContext, args: Formatter.Commands.TagRemove.CommandArgsBefore) { |
| 35 | + if (args.tag === false) { |
| 36 | + return editOrReply(context, '⚠ Unknown Tag'); |
| 37 | + } |
| 38 | + return super.onCancelRun(context, args); |
| 39 | + } |
| 40 | + |
| 41 | + async run(context: Interaction.InteractionContext, args: Formatter.Commands.TagRemove.CommandArgs) { |
| 42 | + return Formatter.Commands.TagRemove.createMessage(context, args); |
| 43 | + } |
| 44 | +} |
0 commit comments