EDA.GuildTemplate.SourceGuild (EDA v0.3.0)

Copy Markdown View Source

A serialized guild snapshot within a template.

Note: All IDs in this struct are placeholder integers, not real snowflakes. For example, @everyone has id 0, categories start at 1, etc. Roles and channels are kept as plain maps since their IDs are placeholders and they contain only a subset of normal guild role/channel fields.

Summary

Functions

Converts a raw serialized source guild map into this struct.

Types

t()

@type t() :: %EDA.GuildTemplate.SourceGuild{
  afk_channel_id: integer() | nil,
  afk_timeout: integer() | nil,
  channels: [map()] | nil,
  default_message_notifications: integer() | nil,
  description: String.t() | nil,
  explicit_content_filter: integer() | nil,
  icon_hash: String.t() | nil,
  name: String.t() | nil,
  preferred_locale: String.t() | nil,
  region: String.t() | nil,
  roles: [map()] | nil,
  system_channel_flags: integer() | nil,
  system_channel_id: integer() | nil,
  verification_level: integer() | nil
}

Functions

from_raw(raw)

@spec from_raw(map()) :: t()

Converts a raw serialized source guild map into this struct.

Roles and channels are kept as plain maps.

Examples

iex> EDA.GuildTemplate.SourceGuild.from_raw(%{"name" => "My Guild", "roles" => [], "channels" => []})
%EDA.GuildTemplate.SourceGuild{name: "My Guild", roles: [], channels: []}