VoiceState
VoiceState ⇐ Base
Represents the state of a voice connection for a user in a guild.
Kind: global class
Extends: Base
- VoiceState ⇐
Base
- new VoiceState([data], guildId, client)
- .guild ⇒
- .channel ⇒
Channel
|null
- .user ⇒
User
|null
- .edit(options) ⇒
Promise
- .setChannel(channel, reason) ⇒
Promise.<void>
- .setDeaf(deaf, reason) ⇒
Promise
- .setMute(mute, reason) ⇒
Promise
- .setSuppress(suppress) ⇒
Promise.<void>
- .setRequestToSpeak(requestToSpeak) ⇒
Promise.<void>
new VoiceState([data], guildId, client)
Constructs a new instance of the class.
Param | Type | Description |
---|---|---|
[data] | Object | The data for the voice state. |
guildId | string | The ID of the guild the voice state belongs to. |
client | Client | The client instance. |
voiceState.guild ⇒
Retrieves the guild associated with this guildId.
Kind: instance property of VoiceState
Returns: The guild object if found, otherwise null.
voiceState.channel ⇒ Channel
| null
Retrieves the channel object associated with this instance.
Kind: instance property of VoiceState
Returns: Channel
| null
- The channel object, or null if it does not exist.
voiceState.user ⇒ User
| null
Retrieves the user associated with this instance.
Kind: instance property of VoiceState
Returns: User
| null
- The user object if found, otherwise null.
voiceState.edit(options) ⇒ Promise
Edits the user’s guild member profile with the given options.
Kind: instance method of VoiceState
Returns: Promise
- A promise that resolves when the edit is complete.
Param | Type | Description |
---|---|---|
options | Object | The options to edit the guild member profile. |
voiceState.setChannel(channel, reason) ⇒ Promise.<void>
Sets the channel for the current object and updates it with the given reason.
Kind: instance method of VoiceState
Returns: Promise.<void>
- - A promise that resolves when the channel is successfully set.
Param | Type | Description |
---|---|---|
channel | Channel | The channel to set. |
reason | string | The reason for setting the channel. |
voiceState.setDeaf(deaf, reason) ⇒ Promise
Sets the deaf status of the user.
Kind: instance method of VoiceState
Returns: Promise
- - A promise that resolves when the deaf status is set.
Param | Type | Description |
---|---|---|
deaf | boolean | Whether the user should be deafened or not. |
reason | string | The reason for setting the deaf status. |
voiceState.setMute(mute, reason) ⇒ Promise
Sets the mute status and reason for an object.
Kind: instance method of VoiceState
Returns: Promise
- - A promise that resolves when the mute status and reason are set.
Param | Type | Description |
---|---|---|
mute | boolean | The mute status to set. |
reason | string | The reason for muting. |
voiceState.setSuppress(suppress) ⇒ Promise.<void>
Sets the suppress property of the voice state for the user in the guild.
Kind: instance method of VoiceState
Returns: Promise.<void>
- - A promise that resolves when the suppress property is set.
Param | Type | Description |
---|---|---|
suppress | boolean | The value to set for the suppress property. |
voiceState.setRequestToSpeak(requestToSpeak) ⇒ Promise.<void>
Sets the “request to speak” status for the user in the guild’s voice channel.
Kind: instance method of VoiceState
Returns: Promise.<void>
- - A promise that resolves when the request to speak status is set.
Param | Type | Description |
---|---|---|
requestToSpeak | boolean | The value indicating whether the user wants to request to speak. |