bot.onVoiceStateUpdate
An event that gets executed, if the bot sees a user updating their voice status. To let the bot listen to the event, add one bot.onVoiceStateUpdate() callback inside your mainfile.
This callback triggers whenever someone joins a voice channel, leaves a voice channel or updates their vc options.

Usage:

1
bot.voiceStateUpdateCommand({ //Command
2
channel: "id" // Log Channel
3
code: `code` //Your code
4
})
Copied!

Example Command:

1
bot.voiceStateUpdateCommand({
2
channel: "772414449839636490"
3
code: `
4
$userTag[$newState[id]] has joined the vc $newState[channelName]
5
$onlyIf[$newState[channelID]!=;]
6
$onlyIf[$oldState[channelID]==;]
7
`
8
})
Copied!

Options:

You can use the functions $newState[] and $oldState[] with the options below to return old and new voice state data.
  • guildID => The ID of the guild the voice state update happened in
  • guildName => The name of the guild this voice state update happened
  • name => The name of the user that updated its voice state
  • id => The ID of the user that updated its voice state
  • channelID => The ID of the voice channel this voice state update occurred in
  • channelName => The name of the voice channel this voice state update occurred in
  • serverDeaf => Whether the user is server deafened
  • selfDeaf => Whether the user is self deafened
  • selfMute => Whether the user is self muted
  • serverMute => Whether the user is server muted
  • sessionID => The ID of this voice session
  • streaming => Whether this user is streaming
  • deaf=> Whether the user is either self-deafened or server-deafened
  • mute => Whether the user is either self-muted or server-muted
  • speaking => Whether the user is speaking
Last modified 1mo ago
Copy link
Edit on GitHub