From 77fb47183fb08fb1d6a741b447662d9f357426ac Mon Sep 17 00:00:00 2001 From: Kwoth Date: Sat, 18 Dec 2021 22:07:00 +0100 Subject: [PATCH] Possible fix for #322 --- src/NadekoBot/Modules/Searches/Services/TranslateService.cs | 2 -- src/NadekoBot/Modules/Utility/Utility.cs | 6 +++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/NadekoBot/Modules/Searches/Services/TranslateService.cs b/src/NadekoBot/Modules/Searches/Services/TranslateService.cs index f383b3172..2692bdb5f 100644 --- a/src/NadekoBot/Modules/Searches/Services/TranslateService.cs +++ b/src/NadekoBot/Modules/Searches/Services/TranslateService.cs @@ -4,7 +4,6 @@ using System.Collections.Generic; using System.Linq; using System.Net; using System.Threading.Tasks; -using AngleSharp.Common; using Discord; using Discord.Net; using LinqToDB; @@ -13,7 +12,6 @@ using Microsoft.EntityFrameworkCore; using NadekoBot.Common.ModuleBehaviors; using NadekoBot.Extensions; using NadekoBot.Services; -using NadekoBot.Services.Database; namespace NadekoBot.Modules.Searches { diff --git a/src/NadekoBot/Modules/Utility/Utility.cs b/src/NadekoBot/Modules/Utility/Utility.cs index a2bbddb7a..4159a4711 100644 --- a/src/NadekoBot/Modules/Utility/Utility.cs +++ b/src/NadekoBot/Modules/Utility/Utility.cs @@ -108,7 +108,11 @@ namespace NadekoBot.Modules.Utility await ctx.Channel.TriggerTypingAsync().ConfigureAwait(false); await _tracker.EnsureUsersDownloadedAsync(ctx.Guild).ConfigureAwait(false); - var users = await ctx.Guild.GetUsersAsync(); + var users = await ctx.Guild.GetUsersAsync( + #if GLOBAL_NADEKO + CacheMode.CacheOnly + #endif + ); var roleUsers = users .Where(u => role is null ? u.RoleIds.Count == 1 : u.RoleIds.Contains(role.Id)) .Select(u => $"`{u.Id, 18}` {u}")