1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-01-31 00:19:00 +03:00
Octobot/TeamOctolings.Octobot
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
..
Attributes Apply official naming guidelines to Octobot (#306) 2024-05-16 20:34:26 +05:00
Commands Add description to /clear's author to clarify its functionality (#315) 2024-05-31 21:46:12 +05:00
Data Apply official naming guidelines to Octobot (#306) 2024-05-16 20:34:26 +05:00
Extensions Upgrade NuGet dependencies (#313) 2024-05-30 15:32:27 +05:00
Parsers Apply official naming guidelines to Octobot (#306) 2024-05-16 20:34:26 +05:00
Responders Handle audit log entries for message deletion being empty (#317) 2024-06-21 19:28:29 +00:00
Services Use MemberData roles when checking permissions & interactions (#312) 2024-05-23 18:21:52 +05:00
BuildInfo.cs Apply official naming guidelines to Octobot (#306) 2024-05-16 20:34:26 +05:00
ColorsList.cs Apply official naming guidelines to Octobot (#306) 2024-05-16 20:34:26 +05:00
Messages.Designer.cs Apply official naming guidelines to Octobot (#306) 2024-05-16 20:34:26 +05:00
Messages.resx Apply official naming guidelines to Octobot (#306) 2024-05-16 20:34:26 +05:00
Messages.ru.resx Apply official naming guidelines to Octobot (#306) 2024-05-16 20:34:26 +05:00
Program.cs Apply official naming guidelines to Octobot (#306) 2024-05-16 20:34:26 +05:00
TeamOctolings.Octobot.csproj Upgrade NuGet dependencies (#313) 2024-05-30 15:32:27 +05:00
Utility.cs Apply official naming guidelines to Octobot (#306) 2024-05-16 20:34:26 +05:00