Skip to content

Commit

Permalink
don't defer when using modals
Browse files Browse the repository at this point in the history
since I think they automatically do that
  • Loading branch information
Techbot121 authored and Meta Construct committed Aug 18, 2024
1 parent c9260b0 commit 6878c71
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions app/services/discord/modules/commands/developer/Ban.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,13 @@ const parseLength = (input: string): number => {
return len;
};

const Ban = async (nickname: string, ctx: Discord.ChatInputCommandInteraction, bot: DiscordBot) => {
await ctx.deferReply();
const Ban = async (
nickname: string,
ctx: Discord.ChatInputCommandInteraction,
bot: DiscordBot,
defer = true
) => {
if (defer) await ctx.deferReply();
const bridge = bot.bridge;
if (!bridge) return;
const selectedServer = ctx.options.getInteger("server") ?? 2;
Expand Down Expand Up @@ -163,7 +168,7 @@ export const SlashBanCommand: SlashCommand = {
});
const response = await ctx.awaitModalSubmit({ time: 60000 }).catch();
if (response) {
await Ban(response.fields.getTextInputValue("nickname_input"), ctx, bot);
await Ban(response.fields.getTextInputValue("nickname_input"), ctx, bot, false);
}
return;
}
Expand Down

0 comments on commit 6878c71

Please sign in to comment.