Class DiscordMemoryCache
A memory cache of Discord entities for a single Shard.
Implements
Inherited Members
Namespace: Discore.Caching
Assembly: Discore.dll
Syntax
public class DiscordMemoryCache : IDisposable
Constructors
| Name | Description |
|---|---|
| DiscordMemoryCache(Shard) | Creates a new Discord entity memory cache. |
Methods
| Name | Description |
|---|---|
| Clear() | Clears the entire cache. |
| Dispose() | Clears the cache and unsubscribes from shard and Gateway events. |
| GetAllGuildIds() | Returns a list of the IDs of all guilds currently in this cache. |
| GetGuild(Snowflake) | Returns the specified guild or null if it is not currently cached. |
| GetGuildCategoryChannel(Snowflake) | Returns the specified guild category channel or, null if it is not currently cached or is not a guild category channel. |
| GetGuildChannel(Snowflake) | Returns the specified guild channel or null if it is not currently cached. |
| GetGuildChannels(Snowflake) | Returns a list of all channels in the given guild or null if the guild is not currently cached. |
| GetGuildMember(Snowflake, Snowflake) | Returns the specified guild member or, null if the member is not currently cached or the guild is not currently cached. |
| GetGuildMembers(Snowflake) | Returns a list of all currently cached members for the given guild, or null if the guild is not currently cached. |
| GetGuildMetadata(Snowflake) | Returns the shard-specific metdata for the given guild or null if the guild is not currently cached. |
| GetGuildNewsChannel(Snowflake) | Returns the specified guild news channel or, null if it is not currently cached or is not a guild news channel. |
| GetGuildStoreChannel(Snowflake) | Returns the specified guild store channel or, null if it is not currently cached or is not a guild store channel. |
| GetGuildTextChannel(Snowflake) | Returns the specified guild text channel or, null if it is not currently cached or is not a guild text channel. |
| GetGuildVoiceChannel(Snowflake) | Returns the specified guild voice channel or, null if it is not currently cached or is not a guild voice channel. |
| GetUnavailableGuildIds() | Returns a list of the IDs of all unavailable guilds currently in this cache. |
| GetUser(Snowflake) | Returns the specified user or null if they are not currently cached. |
| GetUserPresence(Snowflake, Snowflake) | Returns the presence for the specified user or, null if the presence is not currently cached or the guild is not currently cached. |
| GetUserPresences(Snowflake) | Returns a list of all currently cached user presences for the given guild, or null if the guild is not currently cached. |
| GetUsersInVoiceChannel(Snowflake) | Gets a list of the IDs of every user currently in the specified voice channel. Note: Will return an empty list if the voice channel is not cached. |
| GetVoiceState(Snowflake, Snowflake) | Returns the voice state for the specified user or, null if the voice state is not currently cached or the guild is not currently cached. |
| GetVoiceStates(Snowflake) | Returns a list of all currently cached voice states for the given guild, or null if the guild is not currently cached. |
| IsGuildAvailable(Snowflake) | Returns whether the specified guild is available or false if the guild is not known to this cache. |