Class: Rubycord::Events::VoiceServerUpdateEvent

Inherits:
Event
  • Object
show all
Defined in:
lib/rubycord/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.



20
21
22
23
24
25
26
# File 'lib/rubycord/events/voice_server_update.rb', line 20

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.



18
19
20
# File 'lib/rubycord/events/voice_server_update.rb', line 18

def endpoint
  @endpoint
end

#serverServer (readonly)

Returns The server this update is for.

Returns:

  • (Server)

    The server this update is for.



15
16
17
# File 'lib/rubycord/events/voice_server_update.rb', line 15

def server
  @server
end

#tokenString (readonly)

Returns The voice connection token.

Returns:

  • (String)

    The voice connection token



12
13
14
# File 'lib/rubycord/events/voice_server_update.rb', line 12

def token
  @token
end