VoiceState

VoiceState

Represents a voice state.

Constructor

new VoiceState(client, data, options)

Description:
  • Creates the structure for a voice state.

Source:
Parameters:
Name Type Description
client Client

The client instance.

data Object

The raw voice state data from Discord.

options Object

The additional options for this structure.

Properties
Name Type Attributes Description
guildId String

The id of the guild that the voice state belongs to.

nocache Boolean <nullable>

Whether this voice state should be cached.

Members

(readonly, nullable) channel :Channel

Description:
  • The channel involved.

Source:

The channel involved.

Type:

(readonly) channelId :String

Description:
  • The id of the channel involved.

Source:

The id of the channel involved.

Type:
  • String

(readonly) deaf :Boolean

Description:
  • Is server deafened?

Source:

Is server deafened?

Type:
  • Boolean

(readonly, nullable) guild :Guild

Description:
  • The guild that this voice state belongs to.

Source:

The guild that this voice state belongs to.

Type:

(readonly) guildId :String

Description:
  • The id of the guild that this voice state belongs to.

Source:

The id of the guild that this voice state belongs to.

Type:
  • String

(readonly) joined :Number

Description:
  • The UNIX time the user joined the voice channel.

Source:

The UNIX time the user joined the voice channel.

Type:
  • Number

(readonly, nullable) member :Member

Description:
  • The member the voice state is about.

Source:

The member the voice state is about.

Type:

(readonly) memberId :String

Description:
  • The id of the user the voice state is about.

Source:

The id of the user the voice state is about.

Type:
  • String

(readonly) mute :Boolean

Description:
  • Is server muted?

Source:

Is server muted?

Type:
  • Boolean

(readonly, nullable) requestToSpeakTimestamp :Number

Description:
  • The UNIX timestamp of when the user requested to speak.

Source:

The UNIX timestamp of when the user requested to speak.

Type:
  • Number

(readonly) selfDeaf :Boolean

Description:
  • Is self defeaned?

Source:

Is self defeaned?

Type:
  • Boolean

(readonly) selfMute :Boolean

Description:
  • Is self muted?

Source:

Is self muted?

Type:
  • Boolean

(readonly) selfStream :Boolean

Description:
  • Is streaming?

Source:

Is streaming?

Type:
  • Boolean

(readonly) selfVideo :Boolean

Description:
  • Is sharing video?

Source:

Is sharing video?

Type:
  • Boolean

(readonly) suppress :Boolean

Description:
  • Is suppressed (for stage channels)?

Source:

Is suppressed (for stage channels)?

Type:
  • Boolean

Methods

(static) shouldCache(gluonCacheOptions, guildCacheOptions) → {Boolean}

Description:
  • Determines whether the voice state should be cached.

Source:
Parameters:
Name Type Description
gluonCacheOptions GluonCacheOptions

The cache options for the client.

guildCacheOptions GuildCacheOptions

The cache options for the guild.

Returns:
Type
Boolean

toJSON(format) → {Object}

Description:
  • Returns the JSON representation of this structure.

Source:
Parameters:
Name Type Description
format Number

The format to return the data in.

Returns:
Type
Object

toString()

Source: