class Discorb::GuildTemplate::TemplateGuild::Channel

Represents a channel in guild template.

Attributes

bitrate[R]

@return [Integer] The bitrate of the channel.

name[R]

@return [String] The name of the channel.

nsfw[R]

@return [Boolean] Whether the channel is nsfw.

position[R]

@return [Integer] The position of the channel.

rate_limit_per_user[R]

@return [Integer] The rate limit of the channel.

topic[R]

@return [String] The type of the channel.

type[R]

@return [Class] The class of the channel.

user_limit[R]

@return [Integer] The user limit of the channel.

Public Class Methods

new(data) click to toggle source

@!visibility private

# File lib/discorb/guild_template.rb, line 178
def initialize(data)
  @name = data[:name]
  @position = data[:position]
  @topic = data[:topic]
  @bitrate = data[:bitrate]
  @user_limit = data[:user_limit]
  @nsfw = data[:nsfw]
  @rate_limit_per_user = data[:rate_limit_per_user]
  @parent_id = data[:parent_id]
  @permission_overwrites = data[:permission_overwrites].map do |ow|
    [Snowflake.new(ow[:id]), PermissionOverwrite.new(ow[:allow], ow[:deny])]
  end.to_h
  @type = Discorb::Channel.descendants.find { |c| c.channel_type == data[:type] }
end