mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
fix(bot): handle error code responses for application commands
This commit is contained in:
parent
2d39c171cd
commit
507323397a
2 changed files with 63 additions and 12 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue