fix(bot): handle error code responses for application commands

This commit is contained in:
Iris System 2023-05-15 23:19:16 +12:00
parent 2d39c171cd
commit 507323397a
2 changed files with 63 additions and 12 deletions

View file

@ -236,7 +236,11 @@ public class Bot
// Once we've sent it to Sentry, report it to the user (if we have permission to)
var reportChannel = handler.ErrorChannelFor(evt, _config.ClientId);
if (reportChannel == null)
{
if (evt is InteractionCreateEvent ice && ice.Type == Interaction.InteractionType.ApplicationCommand)
await _errorMessageService.InteractionRespondWithErrorMessage(ice, sentryEvent.EventId.ToString());
return;
}
var botPerms = await _cache.PermissionsIn(reportChannel.Value);
if (botPerms.HasFlag(PermissionSet.SendMessages | PermissionSet.EmbedLinks))