1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-04-20 00:43:36 +03:00

add IsDefined for gateway.Author in MessageEditedResponder.cs

This commit is contained in:
neroduckale 2023-12-04 00:10:08 +05:00
parent b5e14a7246
commit f7903260e8
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 399E73062E1A3667

View file

@ -67,7 +67,12 @@ public class MessageEditedResponder : IResponder<IMessageUpdate>
return new ArgumentNullError(nameof(gatewayEvent.ID)); return new ArgumentNullError(nameof(gatewayEvent.ID));
} }
if (gatewayEvent.Author.Value.IsBot.OrDefault(false)) if (!gatewayEvent.Author.IsDefined(out var author))
{
return new ArgumentNullError(nameof(gatewayEvent.Author));
}
if (author.IsBot.OrDefault(false))
{ {
return Result.FromSuccess(); return Result.FromSuccess();
} }