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, 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

#bitrateObject (readonly)

Returns the value of attribute bitrate.



424
425
426
# File 'lib/mij-discord/data/channel.rb', line 424

def bitrate
  @bitrate
end

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

#inspectObject



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