/[sudobot]/branches/2.x/src/commands/automation/EmbedCommand.ts
ViewVC logotype

Contents of /branches/2.x/src/commands/automation/EmbedCommand.ts

Parent Directory Parent Directory | Revision Log Revision Log


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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26