fix(bot): expose PKErrors from message edit proxy handler
This commit is contained in:
parent
3129f05b0f
commit
c91349a1d6
@ -4,6 +4,7 @@ using Myriad.Cache;
|
||||
using Myriad.Extensions;
|
||||
using Myriad.Gateway;
|
||||
using Myriad.Rest;
|
||||
using Myriad.Rest.Types.Requests;
|
||||
using Myriad.Types;
|
||||
|
||||
using PluralKit.Core;
|
||||
@ -76,6 +77,14 @@ public class MessageEdited: IEventHandler<MessageUpdateEvent>
|
||||
}
|
||||
// Catch any failed proxy checks so they get ignored in the global error handler
|
||||
catch (ProxyService.ProxyChecksFailedException) { }
|
||||
|
||||
catch (PKError e)
|
||||
{
|
||||
// User-facing errors, print to the channel properly formatted
|
||||
if (botPermissions.HasFlag(PermissionSet.SendMessages))
|
||||
await _rest.CreateMessage(evt.ChannelId,
|
||||
new MessageRequest { Content = $"{Emojis.Error} {e.Message}" });
|
||||
}
|
||||
}
|
||||
|
||||
private async Task<MessageCreateEvent> GetMessageCreateEvent(MessageUpdateEvent evt, CachedMessage lastMessage,
|
||||
|
Loading…
Reference in New Issue
Block a user