Skip to content
This repository was archived by the owner on Nov 24, 2022. It is now read-only.

Commit 77eac73

Browse files
committed
Defer before invoking any handlers
1 parent 2f8eb9e commit 77eac73

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

TabletBot.Discord/SlashCommands/SlashCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@ public class SlashCommand
1717

1818
public async Task Invoke(SocketSlashCommand command)
1919
{
20+
await command.DeferAsync(true);
2021
if (MinimumPermissions is GuildPermissions permissions)
2122
{
2223
var user = command.User as IGuildUser;
2324
if (HasCorrectPermissions(user))
2425
{
25-
await command.DeferAsync(true);
2626
await Handler(command);
2727
}
2828
else
2929
{
30-
await command.RespondAsync("You do not have permissions to use this command.", ephemeral: true);
30+
await command.FollowupAsync("You do not have permissions to use this command.", ephemeral: true);
3131
}
3232
}
3333
else

0 commit comments

Comments
 (0)