diff options
author | TymanWasTaken <tyman@tyman.tech> | 2021-05-18 23:41:49 -0400 |
---|---|---|
committer | TymanWasTaken <tyman@tyman.tech> | 2021-05-18 23:41:49 -0400 |
commit | 267c2946fc80e75cf01f22d311dd07cfb853f74b (patch) | |
tree | dfd0bd200f405c5e2613a7b8c055e68af7d3edf2 /src/commands/moderation/ban.ts | |
parent | 3b02bab4f786b9beb5afa18606d3e1d8fea0003d (diff) | |
download | tanzanite-267c2946fc80e75cf01f22d311dd07cfb853f74b.tar.gz tanzanite-267c2946fc80e75cf01f22d311dd07cfb853f74b.tar.bz2 tanzanite-267c2946fc80e75cf01f22d311dd07cfb853f74b.zip |
nevermind forgot about these (I'll do the rest later they are annoying to do
Diffstat (limited to 'src/commands/moderation/ban.ts')
-rw-r--r-- | src/commands/moderation/ban.ts | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/src/commands/moderation/ban.ts b/src/commands/moderation/ban.ts index 107de9d..556dd6b 100644 --- a/src/commands/moderation/ban.ts +++ b/src/commands/moderation/ban.ts @@ -5,8 +5,8 @@ import { Ban, Modlog, ModlogType } from '../../lib/models'; import moment from 'moment'; import { Message } from 'discord.js'; import { CommandInteraction } from 'discord.js'; -// import { SlashCommandOption } from '../../lib/extensions/Util'; -// import { ApplicationCommandOptionType } from 'discord-api-types'; +import { SlashCommandOption } from '../../lib/extensions/Util'; +import { ApplicationCommandOptionType } from 'discord-api-types'; const durationAliases: Record<string, string[]> = { weeks: ['w', 'weeks', 'week', 'wk', 'wks'], @@ -51,28 +51,28 @@ export default class PrefixCommand extends BotCommand { 'ban @Tyman being cool', 'ban @Tyman being cool --time 7days' ] - } - // slashCommandOptions: [ - // { - // type: ApplicationCommandOptionType.USER, - // name: 'user', - // description: 'The user to ban', - // required: true - // }, - // { - // type: ApplicationCommandOptionType.STRING, - // name: 'reason', - // description: 'The reason to show in modlogs and audit log', - // required: false - // }, - // { - // type: ApplicationCommandOptionType.STRING, - // name: 'time', - // description: - // 'The time the user should be banned for (default permanent)', - // required: false - // } - // ] + }, + slashCommandOptions: [ + { + type: ApplicationCommandOptionType.USER, + name: 'user', + description: 'The user to ban', + required: true + }, + { + type: ApplicationCommandOptionType.STRING, + name: 'reason', + description: 'The reason to show in modlogs and audit log', + required: false + }, + { + type: ApplicationCommandOptionType.STRING, + name: 'time', + description: + 'The time the user should be banned for (default permanent)', + required: false + } + ] }); } async *genResponses( @@ -199,25 +199,25 @@ export default class PrefixCommand extends BotCommand { } } - // async execSlash( - // message: CommandInteraction, - // { - // user, - // reason, - // time - // }: { - // user: SlashCommandOption<undefined>; - // reason: SlashCommandOption<string>; - // time: SlashCommandOption<string>; - // } - // ): Promise<void> { - // for await (const response of this.genResponses( - // message, - // user.user, - // reason?.value, - // time?.value - // )) { - // await message.reply(response); - // } - // } + async execSlash( + message: CommandInteraction, + { + user, + reason, + time + }: { + user: SlashCommandOption<undefined>; + reason: SlashCommandOption<string>; + time: SlashCommandOption<string>; + } + ): Promise<void> { + for await (const response of this.genResponses( + message, + user.user, + reason?.value, + time?.value + )) { + await message.reply(response); + } + } } |