diff options
Diffstat (limited to '')
-rw-r--r-- | src/srcom/slash_commands.tsx | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/srcom/slash_commands.tsx b/src/srcom/slash_commands.tsx index 3586a81..4aabda3 100644 --- a/src/srcom/slash_commands.tsx +++ b/src/srcom/slash_commands.tsx @@ -430,23 +430,17 @@ const runningTasks = new Map< >(); export class SpeedrunCom extends ApplicationCommandsModule { - static async handleCancelButton(i: MessageComponentInteraction) { + static async handleCancelButton(i: MessageComponentInteraction): Promise<void> { const task = runningTasks.get(i.customID)!; if (!task) { - try { - await i.respond({ - content: "Sorry, but I couldn't find the running task to cancel.", - ephemeral: true, - }); - } catch { - await i.editResponse({ - content: "Sorry, but I couldn't find the running task to cancel.", - ephemeral: true, - }); - } + await i.respond({ + content: "Sorry, but I couldn't find the running task to cancel.", + ephemeral: true, + }); + return; } if (task.user !== i.user.id) { - i.send({ + await i.send({ content: "You are not allowed to cancel this.", ephemeral: true, }); |