/[sudobot]/trunk/src/commands/automation/EmbedCommand.ts
ViewVC logotype

Diff of /trunk/src/commands/automation/EmbedCommand.ts

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 249 by rakin, Mon Jul 29 17:29:12 2024 UTC revision 260 by rakin, Mon Jul 29 17:29:15 2024 UTC
# Line 7  import { emoji } from '../../utils/Emoji Line 7  import { emoji } from '../../utils/Emoji
7    
8  export default class EmbedCommand extends BaseCommand {  export default class EmbedCommand extends BaseCommand {
9      supportsInteractions: boolean = true;      supportsInteractions: boolean = true;
     supportsLegacy = false;  
10      subcommands = ['send', 'schema', 'build'];      subcommands = ['send', 'schema', 'build'];
11    
12      constructor() {      constructor() {
# Line 26  export default class EmbedCommand extend Line 25  export default class EmbedCommand extend
25          }          }
26    
27          if (!options.isInteraction && !this.subcommands.includes(options.args[0])) {          if (!options.isInteraction && !this.subcommands.includes(options.args[0])) {
28              await message.reply(`${emoji('error')} Invalid subcommand provided. Must be one of ${this.subcommands.map(c => `\`${c}\``)}.`);              await message.reply(`${emoji('error')} Invalid subcommand provided. Must be one of ${this.subcommands.map(c => `\`${c}\``).join(', ')}.`);
29              return;              return;
30          }          }
31    
# Line 35  export default class EmbedCommand extend Line 34  export default class EmbedCommand extend
34          const command = client.commands.get('embed__' + subcommand);          const command = client.commands.get('embed__' + subcommand);
35    
36          if (command) {          if (command) {
37                if (!options.isInteraction)
38                    options.args.shift();
39              await command.execute(client, message, options);              await command.execute(client, message, options);
40          }          }
41      }      }

Legend:
Removed from v.249  
changed lines
  Added in v.260

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26