class Discordrb::Events::VoiceStateUpdateEvent

Event raised when a user's voice state updates

Attributes

channel[R]
deaf[R]
mute[R]
old_channel[R]

@return [Channel, nil] the old channel this user was on, or nil if the user is newly joining voice.

self_deaf[R]
self_mute[R]
server[R]
session_id[R]
suppress[R]
token[R]
user[R]

Public Class Methods

new(data, old_channel_id, bot) click to toggle source
# File lib/discordrb/events/voice_state_update.rb, line 14
def initialize(data, old_channel_id, bot)
  @bot = bot

  @token = data['token']
  @suppress = data['suppress']
  @session_id = data['session_id']
  @self_mute = data['self_mute']
  @self_deaf = data['self_deaf']
  @mute = data['mute']
  @deaf = data['deaf']
  @server = bot.server(data['guild_id'].to_i)
  return unless @server

  @channel = bot.channel(data['channel_id'].to_i) if data['channel_id']
  @old_channel = bot.channel(old_channel_id) if old_channel_id
  @user = bot.user(data['user_id'].to_i)
end