class Discordrb::VoiceState

A voice state represents the state of a member’s connection to a voice channel. It includes data like the voice channel the member is connected to and mute/deaf flags.

Attributes

deaf[R]

@return [true, false] whether this voice state’s member is deafened server-wide.

mute[R]

@return [true, false] whether this voice state’s member is muted server-wide.

self_deaf[R]

@return [true, false] whether this voice state’s member has deafened themselves.

self_mute[R]

@return [true, false] whether this voice state’s member has muted themselves.

user_id[R]

@return [Integer] the ID of the user whose voice state is represented by this object.

voice_channel[R]

@return [Channel] the voice channel this voice state’s member is in.

Public Class Methods

new(user_id) click to toggle source

@!visibility private

# File lib/discordrb/data/voice_state.rb, line 26
def initialize(user_id)
  @user_id = user_id
end

Public Instance Methods

update(channel, mute, deaf, self_mute, self_deaf) click to toggle source

Update this voice state with new data from Discord @note For internal use only. @!visibility private

# File lib/discordrb/data/voice_state.rb, line 33
def update(channel, mute, deaf, self_mute, self_deaf)
  @voice_channel = channel
  @mute = mute
  @deaf = deaf
  @self_mute = self_mute
  @self_deaf = self_deaf
end