feature: Add method to clear guild user cache (#1767)

* Add method to clear a SocketGuild's user cache

* Add optional predicate

* Compress overload to be consistant

* Fix global user not clearing (may cause other issues)

* Remove debug code and add param documentation

* Standardise doc string

* Remove old hack-fix

* Rename new method for consistency

* Add missing line to reset downloaderPromise

* Undo accidental whitespace changes

* Rider better actually keep the tab this time

Co-authored-by: Quin Lynch <49576606+quinchs@users.noreply.github.com>
This commit is contained in:
Daniel Baynton
2021-11-26 15:41:55 +00:00
committed by GitHub
parent b9274d115d
commit 19a66bf878
2 changed files with 21 additions and 14 deletions

View File

@@ -115,7 +115,7 @@ namespace Discord.WebSocket
if (_guilds.TryRemove(id, out SocketGuild guild))
{
guild.PurgeChannelCache(this);
guild.PurgeGuildUserCache();
guild.PurgeUserCache();
return guild;
}
return null;
@@ -140,7 +140,7 @@ namespace Discord.WebSocket
internal void PurgeUsers()
{
foreach (var guild in _guilds.Values)
guild.PurgeGuildUserCache();
guild.PurgeUserCache();
}
internal SocketApplicationCommand GetCommand(ulong id)