VoiceStateManager
classe · Source
Manages API methods for VoiceStates and stores their cache.
Extends: CachedManager
Properties
guild
guild: Guild
The guild this manager belongs to Source
cache
cache: Collection<Snowflake, VoiceState>
The cache of this manager Source
_cache
_cache: Collection
The private cache of items for this manager. Source
holds
holds: function
The data structure belonging to this manager. Source
client
client: Client
The client that instantiated this Manager Source
Methods
fetch
async fetch(member: GuildMemberResolvable | '@me', options?: BaseFetchOptions): Promise<VoiceState>
Obtains a user's voice state from discord or from the cache if it's already available. Parameters
| Name | Type | Description |
|---|---|---|
member | GuildMemberResolvable | '@me' | The member whose voice state is to be fetched |
options? | BaseFetchOptions | Additional options for this fetch |
Returns: Promise<VoiceState>
js
// Fetch a member's voice state
guild.voiceStates.fetch("66564597481480192")
.then(console.log)
.catch(console.error);resolve
resolve(idOrInstance: string | Object): Object
Resolves a data entry to a data Object. Parameters
| Name | Type | Description |
|---|---|---|
idOrInstance | string | Object | The id or instance of something in this Manager |
Returns: Object — An instance from this Manager Source
resolveId
resolveId(idOrInstance: string | Object): Snowflake
Resolves a data entry to an instance id. Parameters
| Name | Type | Description |
|---|---|---|
idOrInstance | string | Object | The id or instance of something in this Manager |
Returns: SnowflakeSource