From 166d7fdf24440db71311c2cda95697c06e7b8b36 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Thu, 21 Oct 2021 00:05:53 -0400 Subject: Refactoring, rewrote ButtonPaginator, better permission handling + support for send messages in threads, optimizations, another scam link --- src/commands/dev/say.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/commands/dev/say.ts') diff --git a/src/commands/dev/say.ts b/src/commands/dev/say.ts index 1c797ea..a7e9943 100644 --- a/src/commands/dev/say.ts +++ b/src/commands/dev/say.ts @@ -13,7 +13,7 @@ export default class SayCommand extends BushCommand { }, args: [ { - id: 'say', + id: 'content', type: 'string', match: 'rest', prompt: { start: 'What would you like the bot to say?', retry: '{error} Choose something valid to say.' } @@ -21,20 +21,21 @@ export default class SayCommand extends BushCommand { ], slashOptions: [{ name: 'content', description: 'What would you like the bot to say?', type: 'STRING' }], ownerOnly: true, - clientPermissions: ['SEND_MESSAGES'], + clientPermissions: (m) => util.clientSendAndPermCheck(m), + userPermissions: [], slash: true }); } - public override async exec(message: BushMessage, { say }: { say: string }): Promise { + public override async exec(message: BushMessage, args: { content: string }): Promise { if (!message.author.isOwner()) return await message.util.reply(`${util.emojis.error} Only my developers can run this command.`); await message.delete().catch(() => {}); - await message.util.send({ content: say, allowedMentions: AllowedMentions.none() }); + await message.util.send({ content: args.content, allowedMentions: AllowedMentions.none() }); } - public override async execSlash(message: AkairoMessage, { content }: { content: string }): Promise { + public override async execSlash(message: AkairoMessage, args: { content: string }): Promise { if (!client.config.owners.includes(message.author.id)) { return await message.interaction.reply({ content: `${util.emojis.error} Only my developers can run this command.`, @@ -42,6 +43,6 @@ export default class SayCommand extends BushCommand { }); } await message.interaction.reply({ content: 'Attempting to send message.', ephemeral: true }); - return message.channel!.send({ content, allowedMentions: AllowedMentions.none() }); + return message.channel!.send({ content: args.content, allowedMentions: AllowedMentions.none() }); } } -- cgit