Class: Discordrb::VoiceRegion
- Inherits:
-
Object
- Object
- Discordrb::VoiceRegion
- Defined in:
- lib/discordrb/data/voice_region.rb
Overview
Voice regions are the locations of servers that handle voice communication in Discord
Instance Attribute Summary collapse
-
#custom ⇒ true, false
readonly
Whether this is a custom voice region (used for events/etc).
-
#deprecated ⇒ true, false
readonly
Whether this is a deprecated voice region (avoid switching to these).
-
#id ⇒ String
(also: #to_s)
readonly
Unique ID for the region.
-
#name ⇒ String
readonly
Name of the region.
-
#optimal ⇒ true, false
readonly
If this voice server is the closest to the client.
-
#sample_hostname ⇒ String
readonly
An example hostname for the region.
-
#sample_port ⇒ Integer
readonly
An example port for the region.
-
#vip ⇒ true, false
readonly
If this is a VIP-only server.
Instance Method Summary collapse
-
#initialize(data) ⇒ VoiceRegion
constructor
A new instance of VoiceRegion.
Constructor Details
#initialize(data) ⇒ VoiceRegion
Returns a new instance of VoiceRegion.
31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/discordrb/data/voice_region.rb', line 31 def initialize(data) @id = data['id'] @name = data['name'] @sample_hostname = data['sample_hostname'] @sample_port = data['sample_port'] @vip = data['vip'] @optimal = data['optimal'] @deprecated = data['deprecated'] @custom = data['custom'] end |
Instance Attribute Details
#custom ⇒ true, false (readonly)
Returns whether this is a custom voice region (used for events/etc).
29 30 31 |
# File 'lib/discordrb/data/voice_region.rb', line 29 def custom @custom end |
#deprecated ⇒ true, false (readonly)
Returns whether this is a deprecated voice region (avoid switching to these).
26 27 28 |
# File 'lib/discordrb/data/voice_region.rb', line 26 def deprecated @deprecated end |
#id ⇒ String (readonly) Also known as: to_s
Returns unique ID for the region.
7 8 9 |
# File 'lib/discordrb/data/voice_region.rb', line 7 def id @id end |
#name ⇒ String (readonly)
Returns name of the region.
11 12 13 |
# File 'lib/discordrb/data/voice_region.rb', line 11 def name @name end |
#optimal ⇒ true, false (readonly)
Returns if this voice server is the closest to the client.
23 24 25 |
# File 'lib/discordrb/data/voice_region.rb', line 23 def optimal @optimal end |
#sample_hostname ⇒ String (readonly)
Returns an example hostname for the region.
14 15 16 |
# File 'lib/discordrb/data/voice_region.rb', line 14 def sample_hostname @sample_hostname end |
#sample_port ⇒ Integer (readonly)
Returns an example port for the region.
17 18 19 |
# File 'lib/discordrb/data/voice_region.rb', line 17 def sample_port @sample_port end |
#vip ⇒ true, false (readonly)
Returns if this is a VIP-only server.
20 21 22 |
# File 'lib/discordrb/data/voice_region.rb', line 20 def vip @vip end |