Class: Rubycord::Events::VoiceServerUpdateEvent
- 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
-
#endpoint ⇒ String
readonly
The voice server host.
-
#server ⇒ Server
readonly
The server this update is for.
-
#token ⇒ String
readonly
The voice connection token.
Attributes inherited from Event
Instance Method Summary collapse
-
#initialize(data, bot) ⇒ VoiceServerUpdateEvent
constructor
A new instance of VoiceServerUpdateEvent.
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
#endpoint ⇒ String (readonly)
Returns The voice server host.
18 19 20 |
# File 'lib/rubycord/events/voice_server_update.rb', line 18 def endpoint @endpoint end |
#server ⇒ Server (readonly)
Returns The server this update is for.
15 16 17 |
# File 'lib/rubycord/events/voice_server_update.rb', line 15 def server @server end |
#token ⇒ String (readonly)
Returns The voice connection token.
12 13 14 |
# File 'lib/rubycord/events/voice_server_update.rb', line 12 def token @token end |