mirror of
https://github.com/yawaflua/PL_JusticeBot.git
synced 2025-12-09 20:09:31 +02:00
add timer-cnhager nickname
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using Discord.Interactions;
|
||||
using Discord.WebSocket;
|
||||
using DiscordApp.Database;
|
||||
using Microsoft.VisualBasic;
|
||||
using System.Reflection;
|
||||
|
||||
|
||||
@@ -47,22 +48,16 @@ namespace DiscordApp
|
||||
try
|
||||
{
|
||||
var context = new SocketInteractionContext(client, interaction);
|
||||
|
||||
//await context.Interaction.DeferAsync(true);
|
||||
var result = await handler.ExecuteCommandAsync(context, services);
|
||||
|
||||
if (!result.IsSuccess)
|
||||
switch (result.Error)
|
||||
{
|
||||
case InteractionCommandError.UnmetPrecondition:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
await interaction.RespondAsync($"Возникла какая-то ошибка: {result.Error}", ephemeral: true);
|
||||
}
|
||||
catch
|
||||
{
|
||||
if (interaction.Type is InteractionType.ApplicationCommand)
|
||||
await interaction.GetOriginalResponseAsync().ContinueWith(async (msg) => await msg.Result.DeleteAsync());
|
||||
await interaction.GetOriginalResponseAsync().ContinueWith(async (msg) => await msg.Result.DeleteAsync()); ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user