From 53d2b18f7f73d5696fb7cd86d1c164a790dfdcc3 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Wed, 14 Jul 2021 21:22:09 -0400 Subject: started moving over some other commands --- src/commands/dev/say.ts | 58 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 src/commands/dev/say.ts (limited to 'src/commands/dev/say.ts') diff --git a/src/commands/dev/say.ts b/src/commands/dev/say.ts new file mode 100644 index 0000000..9dc2632 --- /dev/null +++ b/src/commands/dev/say.ts @@ -0,0 +1,58 @@ +import { AllowedMentions, BushCommand, BushMessage } from '@lib'; +import { AkairoMessage } from 'discord-akairo'; + +export default class SayCommand extends BushCommand { + public constructor() { + super('say', { + aliases: ['say'], + category: 'dev', + description: { + content: 'A command make the bot say something.', + usage: 'say ', + examples: ['say hello'] + }, + args: [ + { + id: 'say', + type: 'string', + match: 'rest', + prompt: { + start: 'What would you like the bot to say?', + retry: '{error} Choose something valid to say.' + } + } + ], + slashOptions: [ + { + name: 'content', + description: 'What would you like the bot to say?', + type: 'STRING' + } + ], + ownerOnly: true, + clientPermissions: ['SEND_MESSAGES'], + slash: true + }); + } + + public async exec(message: BushMessage, { say }: { say: string }): Promise { + if (!message.author.isOwner()) + return await message.util.reply(`${this.client.util.emojis.error} Only my developers can run this command.`); + + if (message.deletable) { + await message.delete(); + } + await message.util.send({ content: say, allowedMentions: AllowedMentions.none() }); + } + + public async execSlash(message: AkairoMessage, { content }: { content: string }): Promise { + if (!this.client.config.owners.includes(message.author.id)) { + return await message.interaction.reply({ + content: `${this.client.util.emojis.error} Only my developers can run this command.`, + ephemeral: true + }); + } + await message.interaction.reply({ content: 'Attempting to send message.', ephemeral: true }); + return message.channel.send({ content, allowedMentions: AllowedMentions.none() }); + } +} -- cgit