aboutsummaryrefslogtreecommitdiff
path: root/src/commands/dev/say.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-07-14 21:22:09 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-07-14 21:22:09 -0400
commit53d2b18f7f73d5696fb7cd86d1c164a790dfdcc3 (patch)
treef95f23aad382879b35860d4d3be3642068fac8a2 /src/commands/dev/say.ts
parenteaaae08aeee1fa16a4e1ad0b26fceb42885bfcde (diff)
downloadtanzanite-53d2b18f7f73d5696fb7cd86d1c164a790dfdcc3.tar.gz
tanzanite-53d2b18f7f73d5696fb7cd86d1c164a790dfdcc3.tar.bz2
tanzanite-53d2b18f7f73d5696fb7cd86d1c164a790dfdcc3.zip
started moving over some other commands
Diffstat (limited to 'src/commands/dev/say.ts')
-rw-r--r--src/commands/dev/say.ts58
1 files changed, 58 insertions, 0 deletions
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 <message>',
+ 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<unknown> {
+ 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<unknown> {
+ 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() });
+ }
+}