fix(bot): silence internal errors from initial handler checks

This commit is contained in:
alyssa 2025-01-01 22:30:52 +00:00
parent e44d2afd7e
commit 8d53021863
2 changed files with 20 additions and 9 deletions

View file

@ -86,12 +86,19 @@ public class MessageCreated: IEventHandler<MessageCreateEvent>
}
// Try each handler until we find one that succeeds
// only show exceptions to users if the checks above succeed
try
{
if (await TryHandleCommand(shardId, evt, guild, channel))
return;
if (await TryHandleCommand(shardId, evt, guild, channel))
return;
if (evt.GuildId != null)
await TryHandleProxy(evt, guild, channel, rootChannel.Id, botPermissions);
if (evt.GuildId != null)
await TryHandleProxy(evt, guild, channel, rootChannel.Id, botPermissions);
}
catch (Exception exc)
{
await _bot.HandleError(this, evt, _services, exc, true);
}
}
private async Task TryHandleLogClean(Channel channel, MessageCreateEvent evt)