1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-01-31 09:09:00 +03:00
Octobot/TeamOctolings.Octobot/Responders
Octol1ttle a953053f1d
Handle audit log entries for message deletion being empty (#317)
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>
2024-06-21 19:28:29 +00:00
..
GuildLoadedResponder.cs Seal implicitly used classes (#309) 2024-05-23 17:47:51 +05:00
GuildMemberJoinedResponder.cs Seal implicitly used classes (#309) 2024-05-23 17:47:51 +05:00
GuildMemberLeftResponder.cs Seal implicitly used classes (#309) 2024-05-23 17:47:51 +05:00
GuildUnloadedResponder.cs Seal implicitly used classes (#309) 2024-05-23 17:47:51 +05:00
MessageDeletedResponder.cs Handle audit log entries for message deletion being empty (#317) 2024-06-21 19:28:29 +00:00
MessageEditedResponder.cs Seal implicitly used classes (#309) 2024-05-23 17:47:51 +05:00
MessageReceivedResponder.cs Seal implicitly used classes (#309) 2024-05-23 17:47:51 +05:00