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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 273 - (hide annotations)
Mon Jul 29 17:29:18 2024 UTC (8 months, 1 week ago) by rakin
File MIME type: application/typescript
File size: 1102 byte(s)
chore: final fixup for v3.0.0 release
1 rakin 249 import { CommandInteraction, Message } from 'discord.js';
2 rakin 248 import BaseCommand from '../../utils/structures/BaseCommand';
3     import DiscordClient from '../../client/Client';
4 rakin 249 import CommandOptions from '../../types/CommandOptions';
5 rakin 248 import InteractionOptions from '../../types/InteractionOptions';
6 rakin 249 import { emoji } from '../../utils/Emoji';
7 rakin 248
8     export default class EmbedCommand extends BaseCommand {
9     supportsInteractions: boolean = true;
10 rakin 249 subcommands = ['send', 'schema', 'build'];
11 rakin 248
12     constructor() {
13 rakin 273 super('embed', 'automation', []);
14 rakin 248 }
15    
16 rakin 249 async run(client: DiscordClient, message: Message | CommandInteraction, options: CommandOptions | InteractionOptions) {
17 rakin 271 if (!options.isInteraction) {
18 rakin 249 await message.reply(`${emoji('error')} This command can not be used in legacy mode. Use slash commands instead.`);
19     return;
20     }
21 rakin 248
22 rakin 271 const subcommand = options.options.getSubcommand();
23 rakin 248
24 rakin 249 const command = client.commands.get('embed__' + subcommand);
25 rakin 248
26 rakin 249 if (command) {
27     await command.execute(client, message, options);
28 rakin 248 }
29     }
30     }

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26