Class: Discordrb::Events::VoiceServerUpdateEvent
- 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
-
#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.
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
#endpoint ⇒ String (readonly)
Returns The voice server host.
20 21 22 |
# File 'lib/discordrb/events/voice_server_update.rb', line 20 def endpoint @endpoint end |
#server ⇒ Server (readonly)
Returns The server this update is for.
17 18 19 |
# File 'lib/discordrb/events/voice_server_update.rb', line 17 def server @server end |
#token ⇒ String (readonly)
Returns The voice connection token.
14 15 16 |
# File 'lib/discordrb/events/voice_server_update.rb', line 14 def token @token end |