Class: MijDiscord::Data::VoiceChannel

Inherits:
Channel
  • Object
show all
Defined in:
lib/mij-discord/data/channel.rb

Constant Summary

Constants inherited from Channel

Channel::TYPES

Instance Attribute Summary collapse

Attributes inherited from Channel

#bot, #cache, #name, #parent_id, #permission_overwrites, #position, #server, #type

Attributes included from IDObject

#id

Instance Method Summary collapse

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

#bitrateObject (readonly)

Returns the value of attribute bitrate.



402
403
404
# File 'lib/mij-discord/data/channel.rb', line 402

def bitrate
  @bitrate
end

#user_limitObject (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)
  set_options(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)
  set_options(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