mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-01-31 09:09:00 +03:00
Octol1ttle
a953053f1d
In order to determine who deleted a message, Octobot fetches the audit log with a filter on the action "Message Delete", gets the latest entry and uses its author if the timestamps roughly match. However, if the filter returns no entries (as in, no message deletions are present in the audit log), `Single()` will throw an exception with the message `Sequence contains no elements`. To fix this, this PR replaces `Single()` with `SingleOrDefault()` and adds a null-check on `auditLog` in the form of a pattern access Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> |
||
---|---|---|
.. | ||
GuildLoadedResponder.cs | ||
GuildMemberJoinedResponder.cs | ||
GuildMemberLeftResponder.cs | ||
GuildUnloadedResponder.cs | ||
MessageDeletedResponder.cs | ||
MessageEditedResponder.cs | ||
MessageReceivedResponder.cs |