class Discorb::GuildTemplate::TemplateGuild

Represents a guild in guild template.

Attributes

afk_timeout[R]

@return [Integer] The AFK timeout of the guild.

channels[R]

@return [Discorb::Dictionary{Discorb::Snowflake => Discorb::GuildChannel}] A dictionary of channels in the guild.

default_message_notifications[R]

@return [:all_messages, :only_mentions] The default message notification level of the guild.

description[R]

@return [String] The description of the guild.

explicit_content_filter[R]

@return [:disabled_in_text, :members_without_roles, :all_members] The explict content filter level of the guild.

name[R]

@return [String] The name of the guild.

preferred_locale[R]

@return [Symbol] The preffered language of the guild. @note This modifies the language code, `-` will be replaced with `_`.

roles[R]

@return [Discorb::Dictionary{Discorb::Snowflake => Discorb::Role}] A dictionary of roles in the guild.

system_channel_flags[R]

@return [Discorb::Guild::SystemChannelFlag] The flag for the system channel.

verification_level[R]

@return [:none, :low, :medium, :high, :very_high] The verification level of the guild.

widget_enabled[R]

@return [Boolean] Whether the guild enabled the widget.

widget_enabled?[R]

@return [Boolean] Whether the guild enabled the widget.

Public Class Methods

new(data) click to toggle source

@!visibility private

# File lib/discorb/guild_template.rb, line 121
def initialize(data)
  @name = data[:name]
  @description = data[:description]
  @region = data[:region]
  @verification_level = Discorb::Guild.mfa_levels[data[:verification_level]]
  @default_message_notifications = Discorb::Guild.notification_levels[data[:default_message_notifications]]
  @explicit_content_filter = Discorb::Guild.explicit_content_filter[data[:explicit_content_filter]]
  @preferred_locale = data[:preferred_locale]
  @afk_timeout = data[:afk_timeout]
  @roles = data[:roles].map { |r| Role.new(r) }
  @channels = data[:channels].map { |c| Channel.new(c) }
  @system_channel_flags = Discorb::SystemChannelFlag.new(data[:system_channel_flags])
end