diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-10-21 00:05:53 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-10-21 00:05:53 -0400 |
commit | 166d7fdf24440db71311c2cda95697c06e7b8b36 (patch) | |
tree | 23b0400362b5f3035b156200eb634d202aa54741 /src/commands/dev/say.ts | |
parent | 08f33f7d450c8920afc3b9fb8886729547065313 (diff) | |
download | tanzanite-166d7fdf24440db71311c2cda95697c06e7b8b36.tar.gz tanzanite-166d7fdf24440db71311c2cda95697c06e7b8b36.tar.bz2 tanzanite-166d7fdf24440db71311c2cda95697c06e7b8b36.zip |
Refactoring, rewrote ButtonPaginator, better permission handling + support for send messages in threads, optimizations, another scam link
Diffstat (limited to 'src/commands/dev/say.ts')
-rw-r--r-- | src/commands/dev/say.ts | 13 |
1 files changed, 7 insertions, 6 deletions
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<unknown> { + public override async exec(message: BushMessage, args: { content: string }): Promise<unknown> { 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<unknown> { + public override async execSlash(message: AkairoMessage, args: { content: string }): Promise<unknown> { 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() }); } } |