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

Resolve conversations

Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
This commit is contained in:
Macintxsh 2023-12-04 18:05:37 +03:00
parent 0580330b3a
commit 8293a0190a
Signed by: mctaylors
GPG key ID: 7181BEBE676903C1
2 changed files with 2 additions and 2 deletions

View file

@ -8,7 +8,7 @@ public static class CollectionExtensions
this IEnumerable<TSource> source, Func<TSource, TResult> selector) this IEnumerable<TSource> source, Func<TSource, TResult> selector)
{ {
var list = source.ToList(); var list = source.ToList();
return list.Count != 0 ? list.Max(selector) : default; return list.Count > 0 ? list.Max(selector) : default;
} }
public static void AddIfFailed(this List<Result> list, Result result) public static void AddIfFailed(this List<Result> list, Result result)

View file

@ -126,7 +126,7 @@ public sealed class ScheduledEventUpdateService : BackgroundService
{ {
var filtered = from.Where(schEvent => schEvent.ID == id); var filtered = from.Where(schEvent => schEvent.ID == id);
var filteredArray = filtered.ToArray(); var filteredArray = filtered.ToArray();
return filteredArray.Length != 0 return filteredArray.Length > 0
? Result<IGuildScheduledEvent>.FromSuccess(filteredArray.Single()) ? Result<IGuildScheduledEvent>.FromSuccess(filteredArray.Single())
: new NotFoundError(); : new NotFoundError();
} }