Nostrum v0.4.1 Nostrum.Struct.Guild View Source
Struct representing a Discord guild.
Link to this section Summary
Types
The id of the guild's afk channel
The time someone must be afk before being moved
Application id of the guild creator if it is bot created.
A Nostrum.Struct.Guild
that is fully available.
List of channels
Default message notifications level.
The id of the embedded channel
Whether the guild is emeddable
List of emojis
Explicit content filter level.
List of guild features
The hash of the guild's icon
The guild's id
Date the bot user joined the guild
Whether the guild is considered 'large'
Total number of members in the guild
List of members
Required MFA level of the guild
The name of the guild.
The id of the guild owner
The id of the voice region
A Nostrum.Struct.Guild
that is sent on guild-specific rest endpoints.
List of roles
The hash of the guild's splash
The id of the channel to which system messages are sent.
Whether the guild is avaliable
A Nostrum.Struct.Guild
that is unavailable.
A Nostrum.Struct.Guild
that is sent on user-specific rest endpoints.
The level of verification
List of voice states as maps
The channel id for the server widget.
Whether or not the server widget is enabled.
Functions
Returns the URL of a guild's icon, or nil
if there is no icon.
Returns the URL of a guild's splash, or nil
if there is no splash.
Link to this section Types
afk_channel_id()
View Source
afk_channel_id() :: Nostrum.Snowflake.t() | nil
afk_channel_id() :: Nostrum.Snowflake.t() | nil
The id of the guild's afk channel
afk_timeout()
View Source
afk_timeout() :: integer()
afk_timeout() :: integer()
The time someone must be afk before being moved
application_id()
View Source
application_id() :: Nostrum.Snowflake.t() | nil
application_id() :: Nostrum.Snowflake.t() | nil
Application id of the guild creator if it is bot created.
available_guild()
View Source
available_guild() :: %Nostrum.Struct.Guild{
afk_channel_id: afk_channel_id(),
afk_timeout: afk_timeout(),
application_id: application_id(),
channels: channels(),
default_message_notifications: default_message_notifications(),
embed_channel_id: embed_channel_id(),
embed_enabled: embed_enabled(),
emojis: emojis(),
explicit_content_filter: explicit_content_filter(),
features: features(),
icon: icon(),
id: id(),
joined_at: joined_at(),
large: large(),
member_count: member_count(),
members: members(),
mfa_level: mfa_level(),
name: name(),
owner_id: owner_id(),
region: region(),
roles: roles(),
splash: splash(),
system_channel_id: system_channel_id(),
unavailable: false,
verification_level: verification_level(),
voice_states: voice_states(),
widget_channel_id: widget_channel_id(),
widget_enabled: widget_enabled()
}
available_guild() :: %Nostrum.Struct.Guild{ afk_channel_id: afk_channel_id(), afk_timeout: afk_timeout(), application_id: application_id(), channels: channels(), default_message_notifications: default_message_notifications(), embed_channel_id: embed_channel_id(), embed_enabled: embed_enabled(), emojis: emojis(), explicit_content_filter: explicit_content_filter(), features: features(), icon: icon(), id: id(), joined_at: joined_at(), large: large(), member_count: member_count(), members: members(), mfa_level: mfa_level(), name: name(), owner_id: owner_id(), region: region(), roles: roles(), splash: splash(), system_channel_id: system_channel_id(), unavailable: false, verification_level: verification_level(), voice_states: voice_states(), widget_channel_id: widget_channel_id(), widget_enabled: widget_enabled() }
A Nostrum.Struct.Guild
that is fully available.
channels()
View Source
channels() ::
%{required(Nostrum.Struct.Channel.id()) => Nostrum.Struct.Channel.t()} | nil
channels() :: %{required(Nostrum.Struct.Channel.id()) => Nostrum.Struct.Channel.t()} | nil
List of channels
default_message_notifications()
View Source
default_message_notifications() :: integer()
default_message_notifications() :: integer()
Default message notifications level.
embed_channel_id()
View Source
embed_channel_id() :: Nostrum.Snowflake.t() | nil
embed_channel_id() :: Nostrum.Snowflake.t() | nil
The id of the embedded channel
embed_enabled()
View Source
embed_enabled() :: boolean() | nil
embed_enabled() :: boolean() | nil
Whether the guild is emeddable
emojis()
View Source
emojis() :: [Nostrum.Struct.Emoji.t()]
emojis() :: [Nostrum.Struct.Emoji.t()]
List of emojis
explicit_content_filter()
View Source
explicit_content_filter() :: integer()
explicit_content_filter() :: integer()
Explicit content filter level.
features()
View Source
features() :: [String.t()]
features() :: [String.t()]
List of guild features
icon()
View Source
icon() :: String.t() | nil
icon() :: String.t() | nil
The hash of the guild's icon
id()
View Source
id() :: Nostrum.Snowflake.t()
id() :: Nostrum.Snowflake.t()
The guild's id
joined_at()
View Source
joined_at() :: String.t() | nil
joined_at() :: String.t() | nil
Date the bot user joined the guild
large()
View Source
large() :: boolean() | nil
large() :: boolean() | nil
Whether the guild is considered 'large'
member_count()
View Source
member_count() :: integer() | nil
member_count() :: integer() | nil
Total number of members in the guild
members()
View Source
members() :: %{required(User.id()) => Nostrum.Struct.Guild.Member.t()} | nil
members() :: %{required(User.id()) => Nostrum.Struct.Guild.Member.t()} | nil
List of members
mfa_level()
View Source
mfa_level() :: integer()
mfa_level() :: integer()
Required MFA level of the guild
name()
View Source
name() :: String.t()
name() :: String.t()
The name of the guild.
owner_id()
View Source
owner_id() :: Nostrum.Snowflake.t()
owner_id() :: Nostrum.Snowflake.t()
The id of the guild owner
region()
View Source
region() :: String.t()
region() :: String.t()
The id of the voice region
rest_guild()
View Source
rest_guild() :: %Nostrum.Struct.Guild{
afk_channel_id: afk_channel_id(),
afk_timeout: afk_timeout(),
application_id: application_id(),
channels: nil,
default_message_notifications: default_message_notifications(),
embed_channel_id: embed_channel_id(),
embed_enabled: embed_enabled(),
emojis: emojis(),
explicit_content_filter: explicit_content_filter(),
features: features(),
icon: icon(),
id: id(),
joined_at: nil,
large: nil,
member_count: nil,
members: nil,
mfa_level: mfa_level(),
name: name(),
owner_id: owner_id(),
region: region(),
roles: roles(),
splash: splash(),
system_channel_id: system_channel_id(),
unavailable: nil,
verification_level: verification_level(),
voice_states: nil,
widget_channel_id: widget_channel_id(),
widget_enabled: widget_enabled()
}
rest_guild() :: %Nostrum.Struct.Guild{ afk_channel_id: afk_channel_id(), afk_timeout: afk_timeout(), application_id: application_id(), channels: nil, default_message_notifications: default_message_notifications(), embed_channel_id: embed_channel_id(), embed_enabled: embed_enabled(), emojis: emojis(), explicit_content_filter: explicit_content_filter(), features: features(), icon: icon(), id: id(), joined_at: nil, large: nil, member_count: nil, members: nil, mfa_level: mfa_level(), name: name(), owner_id: owner_id(), region: region(), roles: roles(), splash: splash(), system_channel_id: system_channel_id(), unavailable: nil, verification_level: verification_level(), voice_states: nil, widget_channel_id: widget_channel_id(), widget_enabled: widget_enabled() }
A Nostrum.Struct.Guild
that is sent on guild-specific rest endpoints.
roles()
View Source
roles() :: %{
required(Nostrum.Struct.Guild.Role.id()) => Nostrum.Struct.Guild.Role.t()
}
roles() :: %{ required(Nostrum.Struct.Guild.Role.id()) => Nostrum.Struct.Guild.Role.t() }
List of roles
splash()
View Source
splash() :: String.t() | nil
splash() :: String.t() | nil
The hash of the guild's splash
system_channel_id()
View Source
system_channel_id() :: Nostrum.Snowflake.t() | nil
system_channel_id() :: Nostrum.Snowflake.t() | nil
The id of the channel to which system messages are sent.
t()
View Source
t() :: available_guild() | unavailable_guild() | rest_guild() | user_guild()
t() :: available_guild() | unavailable_guild() | rest_guild() | user_guild()
user_guild()
View Source
user_guild() :: %Nostrum.Struct.Guild{
afk_channel_id: nil,
afk_timeout: nil,
application_id: nil,
channels: nil,
default_message_notifications: nil,
embed_channel_id: nil,
embed_enabled: nil,
emojis: nil,
explicit_content_filter: nil,
features: nil,
icon: icon(),
id: id(),
joined_at: nil,
large: nil,
member_count: nil,
members: nil,
mfa_level: nil,
name: name(),
owner_id: nil,
region: nil,
roles: nil,
splash: nil,
system_channel_id: nil,
unavailable: nil,
verification_level: nil,
voice_states: nil,
widget_channel_id: nil,
widget_enabled: nil
}
user_guild() :: %Nostrum.Struct.Guild{ afk_channel_id: nil, afk_timeout: nil, application_id: nil, channels: nil, default_message_notifications: nil, embed_channel_id: nil, embed_enabled: nil, emojis: nil, explicit_content_filter: nil, features: nil, icon: icon(), id: id(), joined_at: nil, large: nil, member_count: nil, members: nil, mfa_level: nil, name: name(), owner_id: nil, region: nil, roles: nil, splash: nil, system_channel_id: nil, unavailable: nil, verification_level: nil, voice_states: nil, widget_channel_id: nil, widget_enabled: nil }
A Nostrum.Struct.Guild
that is sent on user-specific rest endpoints.
verification_level()
View Source
verification_level() :: integer()
verification_level() :: integer()
The level of verification
voice_states()
View Source
voice_states() :: [map()] | nil
voice_states() :: [map()] | nil
List of voice states as maps
widget_channel_id()
View Source
widget_channel_id() :: Nostrum.Snowflake.t()
widget_channel_id() :: Nostrum.Snowflake.t()
The channel id for the server widget.
widget_enabled()
View Source
widget_enabled() :: boolean() | nil
widget_enabled() :: boolean() | nil
Whether or not the server widget is enabled.
Link to this section Functions
icon_url(guild, image_format \\ "webp") View Source
Returns the URL of a guild's icon, or nil
if there is no icon.
Supported image formats are PNG, JPEG, and WebP.
Examples
iex> guild = %Nostrum.Struct.Guild{icon: "86e39f7ae3307e811784e2ffd11a7310",
...> id: 41771983423143937}
iex> Nostrum.Struct.Guild.icon_url(guild)
"https://cdn.discordapp.com/icons/41771983423143937/86e39f7ae3307e811784e2ffd11a7310.webp"
iex> Nostrum.Struct.Guild.icon_url(guild, "png")
"https://cdn.discordapp.com/icons/41771983423143937/86e39f7ae3307e811784e2ffd11a7310.png"
iex> guild = %Nostrum.Struct.Guild{icon: nil}
iex> Nostrum.Struct.Guild.icon_url(guild)
nil
splash_url(guild, image_format \\ "webp") View Source
Returns the URL of a guild's splash, or nil
if there is no splash.
Supported image formats are PNG, JPEG, and WebP.
Examples
iex> guild = %Nostrum.Struct.Guild{splash: "86e39f7ae3307e811784e2ffd11a7310",
...> id: 41771983423143937}
iex> Nostrum.Struct.Guild.splash_url(guild)
"https://cdn.discordapp.com/splashes/41771983423143937/86e39f7ae3307e811784e2ffd11a7310.webp"
iex> Nostrum.Struct.Guild.splash_url(guild, "png")
"https://cdn.discordapp.com/splashes/41771983423143937/86e39f7ae3307e811784e2ffd11a7310.png"
iex> guild = %Nostrum.Struct.Guild{splash: nil}
iex> Nostrum.Struct.Guild.splash_url(guild)
nil