alchemy v0.6.0 Alchemy.Guild

Guilds represent a collection of users in a “server”. This module contains information about the types, and subtypes related to guilds, as well as some useful functions related to them.

Summary

Types

Represents a custom emoji in a guild

Represents an guild’s integration with a service, (i.e. twitch)

Represents the account of an integration

Represents a member in a guild

Represents the presence of a user in a guild

Represents a role in a guild

t()

Represents a guild

An iso_8601 timestamp

Types

emoji :: %Alchemy.Guild.Emoji{id: String.t, managed: Boolean, name: String.t, require_colons: Boolean, roles: [String.t]}

Represents a custom emoji in a guild.

The string representation of this struct will be the markdown necessary to use it. i.e. Cogs.say("#{emoji}") will send the emoji.

  • id The id of this emoji.
  • name The name of this emoji.
  • roles A list of role ids who can use this role.
  • require_colons Whether or not this emoji must be wrapped in colons.
  • managed Whether or not this emoji is managed.
integration :: %Alchemy.Guild.Integration{account: integration_account, enabled: Boolean, expire_behaviour: Integer, expire_grace_period: Integer, id: snowflake, name: String.t, role_id: snowflake, synced_at: timestamp, syncing: Boolean, type: String.t, user: Alchemy.User.t}

Represents an guild’s integration with a service, (i.e. twitch)

  • id The id of the integration.
  • name The name of the integration.
  • type Integration type; youtube, twitch, etc.
  • enabled Whether or not the integration is enabled.
  • syncing Whether or not the integration is syncing.
  • role_id The id of the role associated with “subscribers” to this integration.
  • expire_behaviour The behaviour of expiring subscribers.
  • expire_grace_period The grace period before expiring subscribers.
  • user The user for this integration.
  • account The integration’s account information.
  • synced_at When this integration was last synced.
integration_account :: %Alchemy.Guild.Integration.Account{id: snowflake, name: String.t}

Represents the account of an integration.

  • id The id of the account.
  • name The name of the account.
member :: %Alchemy.Guild.GuildMember{deaf: Boolean, joined_at: timestamp, mute: Boolean, nick: String.t | nil, roles: [snowflake], user: Alchemy.User.t}

Represents a member in a guild.

  • user A user struct containing information about the underlying user.
  • nick An optional nickname for this member.
  • roles A list of ids corresponding to roles the member has.
  • joined_at The timestamp of when this member joined the guild.
  • deaf Whether the user is currently deafened.
  • mute Whether the user is currently muted.
presence :: %Alchemy.Guild.Presence{game: String.t | nil, guild_id: snowflake, roles: [snowflake], status: String.t, user: Alchemy.User.t}

Represents the presence of a user in a guild.

  • user The user this presence is for.
  • roles A list of role ids this user belongs to.
  • game The current activity of the user, or nil.
  • guild_id The id of the guild this presences is in.
  • status “idle”, “online”, or “offline”
role :: %Alchemy.Guild.Role{color: Integer, hoist: Boolean, id: snowflake, managed: Boolean, mentionable: Boolean, name: String.t, permissions: Integer, position: Integer}

Represents a role in a guild.

  • id The id of the role.
  • name The name of the role.
  • color The color of the role.
  • hoist Whether the role is “hoisted” above others in the sidebar.
  • position The position of the role in a guild.
  • permission The bitset of permissions for this role. See the Permissions module for more information.
  • managed Whether this role is managed by an integration.
  • mentionable Whether this role is mentionable.
t :: %Alchemy.Guild{afk_channel_id: String.t | nil, afk_timeout: Integer, channels: [Alchemy.Channel.t], default_message_notifications: Integer, embed_enabled: Boolean, emojis: [emoji], features: [String.t], icon: String.t, id: snowflake, joined_at: timestamp, large: Boolean, member_count: Integer, members: [member], mfa_level: Integer, name: String.t, owner: snowflake, presences: [Alchemy.Guild.Presence.t], region: String.t, roles: [Guild.role], splash: String.t | nil, unavailable: Boolean, verification_level: Integer, voice_states: [Alchemy.Voice.state]}

Represents a guild.

  • id

    The id of this guild.

  • name

    The name of this guild.

  • icon The image hash of the icon image.
  • splash The image hash of the splash image. Not a lot of guilds have a hash.
  • owner_id The user id of the guild’s owner.
  • region The region of the guild.
  • afk_channel_id The id of the afk channel, if the guild has one.
  • afk_timeout The afk timeout in seconds.
  • embed_enabled Whether this guild is embeddable.
  • verification_level The level of verification this guild requires.
  • default_message_notifications The default message notifications level.
  • roles A list of the roles in this server.
  • emojis A list of custom emojis in this server.
  • features A list of guild features.
  • mfa_level The required mfa level for the guild.

The following fields will be missing for guilds accessed from outside the Cache:

  • joined_at The timestamp of guild creation.
  • large Whether or not this guild is considered “large”.
  • unavailable This should never be true for guilds.
  • member_count The number of members a guild contains.
  • voice_states A list of voice states of the guild.
  • members A list of members in the guild.
  • channels A list of channels in the guild.
  • presences A list of presences in the guild.
timestamp :: String.t

An iso_8601 timestamp.

Functions

from_map(map)