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.
- #inspect ⇒ Object
- #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, timestamp
Constructor Details
#initialize(data, bot, server) ⇒ VoiceChannel
Returns a new instance of VoiceChannel.
429 430 431 |
# File 'lib/mij-discord/data/channel.rb', line 429 def initialize(data, bot, server) super(data, bot, server) end |
Instance Attribute Details
#bitrate ⇒ Object (readonly)
Returns the value of attribute bitrate.
424 425 426 |
# File 'lib/mij-discord/data/channel.rb', line 424 def bitrate @bitrate end |
#user_limit ⇒ Object (readonly) Also known as: limit
Returns the value of attribute user_limit.
426 427 428 |
# File 'lib/mij-discord/data/channel.rb', line 426 def user_limit @user_limit end |
Instance Method Details
#inspect ⇒ Object
456 457 458 |
# File 'lib/mij-discord/data/channel.rb', line 456 def inspect MijDiscord.make_inspect(self, :id, :name, :type, :position, :bitrate, :user_limit) end |
#set_bitrate(rate, reason = nil) ⇒ Object Also known as: bitrate=
440 441 442 443 |
# File 'lib/mij-discord/data/channel.rb', line 440 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=
447 448 449 450 |
# File 'lib/mij-discord/data/channel.rb', line 447 def set_user_limit(limit, reason = nil) (reason, user_limit: limit) nil end |
#update_data(data) ⇒ Object
433 434 435 436 437 438 |
# File 'lib/mij-discord/data/channel.rb', line 433 def update_data(data) super(data) @bitrate = data.fetch('bitrate', @bitrate) @user_limit = data.fetch('user_limit', @user_limit) end |