Skip to content

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

readonly · private

_cache: Collection

The private cache of items for this manager. Source

holds

readonly · private

holds: function

The data structure belonging to this manager. Source

client

readonly

client: Client

The client that instantiated this Manager Source

Methods

fetch

async

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

NameTypeDescription
memberGuildMemberResolvable | '@me'The member whose voice state is to be fetched
options?BaseFetchOptionsAdditional options for this fetch

Returns: Promise<VoiceState>

js
// Fetch a member's voice state
guild.voiceStates.fetch("66564597481480192")
   .then(console.log)
   .catch(console.error);

Source

resolve

resolve(idOrInstance: string | Object): Object

Resolves a data entry to a data Object. Parameters

NameTypeDescription
idOrInstancestring | ObjectThe 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

NameTypeDescription
idOrInstancestring | ObjectThe id or instance of something in this Manager

Returns: SnowflakeSource

Unofficial software. Not affiliated with or supported by Discord.