mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
Hopefully fix user cache error in ReactionAdd
This commit is contained in:
parent
3b47785aa0
commit
3e297178c7
2 changed files with 16 additions and 0 deletions
|
|
@ -29,6 +29,11 @@ namespace PluralKit.Bot
|
|||
{
|
||||
// Only proxies in guild text channels
|
||||
if (evt.Channel.Type != ChannelType.Text) return;
|
||||
|
||||
// Sometimes we get events from users that aren't in the user cache
|
||||
// In that case we get a "broken" user object (where eg. calling IsBot throws an exception)
|
||||
// We just ignore all of those for now, should be quite rare...
|
||||
if (!evt.Client.TryGetCachedUser(evt.User.Id, out _)) return;
|
||||
|
||||
// Ignore reactions from bots (we can't DM them anyway)
|
||||
if (evt.User.IsBot) return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue