Class: Discordrb::Events::VoiceServerUpdateEvent

Inherits:
Event
  • Object
show all
Defined in:
lib/discordrb/events/voice_server_update.rb

Overview

Event raised when a server's voice server is updating. Sent when initially connecting to voice and when a voice instance fails over to a new server. This event is exposed for use with library agnostic interfaces like telecom and lavalink.

Instance Attribute Summary collapse

Attributes inherited from Event

#bot

Instance Method Summary collapse

Constructor Details

#initialize(data, bot) ⇒ VoiceServerUpdateEvent

Returns a new instance of VoiceServerUpdateEvent.


22
23
24
25
26
27
28
# File 'lib/discordrb/events/voice_server_update.rb', line 22

def initialize(data, bot)
  @bot = bot

  @token = data['token']
  @endpoint = data['endpoint']
  @server = bot.server(data['guild_id'])
end

Instance Attribute Details

#endpointString (readonly)

Returns The voice server host.

Returns:

  • (String)

    The voice server host.


20
21
22
# File 'lib/discordrb/events/voice_server_update.rb', line 20

def endpoint
  @endpoint
end

#serverServer (readonly)

Returns The server this update is for.

Returns:

  • (Server)

    The server this update is for.


17
18
19
# File 'lib/discordrb/events/voice_server_update.rb', line 17

def server
  @server
end

#tokenString (readonly)

Returns The voice connection token.

Returns:

  • (String)

    The voice connection token


14
15
16
# File 'lib/discordrb/events/voice_server_update.rb', line 14

def token
  @token
end