Class: MijDiscord::Data::VoiceChannel
- Defined in:
- lib/mij-discord/data/channel.rb
Constant Summary
Constants inherited from Channel
Instance Attribute Summary collapse
-
#bitrate ⇒ Object
readonly
Returns the value of attribute bitrate.
-
#user_limit ⇒ Object
(also: #limit)
readonly
Returns the value of attribute user_limit.
Attributes inherited from Channel
#bot, #cache, #name, #parent_id, #permission_overwrites, #position, #server, #type
Attributes included from IDObject
Instance Method Summary collapse
-
#initialize(data, bot, server) ⇒ VoiceChannel
constructor
A new instance of VoiceChannel.
- #set_bitrate(rate, reason = nil) ⇒ Object (also: #bitrate=)
- #set_user_limit(limit, reason = nil) ⇒ Object (also: #user_limit=, #set_limit, #limit=)
- #update_data(data) ⇒ Object
Methods inherited from Channel
#category?, create, #default_channel?, #define_overwrite, #delete, #delete_overwrite, #group?, #member_overwrites, #mention, #parent, #pm?, #private?, #role_overwrites, #set_name, #set_options, #set_overwrites, #set_parent, #set_position, #sync_overwrites, #text?, #voice?
Methods included from IDObject
#==, #creation_time, #hash, synthesize
Constructor Details
#initialize(data, bot, server) ⇒ VoiceChannel
Returns a new instance of VoiceChannel.
407 408 409 |
# File 'lib/mij-discord/data/channel.rb', line 407 def initialize(data, bot, server) super(data, bot, server) end |
Instance Attribute Details
#bitrate ⇒ Object (readonly)
Returns the value of attribute bitrate.
402 403 404 |
# File 'lib/mij-discord/data/channel.rb', line 402 def bitrate @bitrate end |
#user_limit ⇒ Object (readonly) Also known as: limit
Returns the value of attribute user_limit.
404 405 406 |
# File 'lib/mij-discord/data/channel.rb', line 404 def user_limit @user_limit end |
Instance Method Details
#set_bitrate(rate, reason = nil) ⇒ Object Also known as: bitrate=
418 419 420 421 |
# File 'lib/mij-discord/data/channel.rb', line 418 def set_bitrate(rate, reason = nil) (reason, bitrate: rate) nil end |
#set_user_limit(limit, reason = nil) ⇒ Object Also known as: user_limit=, set_limit, limit=
425 426 427 428 |
# File 'lib/mij-discord/data/channel.rb', line 425 def set_user_limit(limit, reason = nil) (reason, user_limit: limit) nil end |
#update_data(data) ⇒ Object
411 412 413 414 415 416 |
# File 'lib/mij-discord/data/channel.rb', line 411 def update_data(data) super(data) @bitrate = data.fetch('bitrate', @bitrate) @user_limit = data.fetch('user_limit', @user_limit) end |