Alchemy.Channel (alchemy v0.7.0)

This module contains useful functions for operating on Channels.

Link to this section Summary

Types

Represents a channel category in a guild.

Represents a private message between the bot and another user.

Represents a dm channel between multiple users.

Represents an Invite object along with the metadata.

Represents the channel an invite is for

Represents the guild an invite is for.

Represents a permission OverWrite object

t()

The general channel type, representing one of 5 variants.

Represents a normal text channel in a guild

Represents a voice channel in a guild.

Link to this section Types

Link to this type

channel_category()

Specs

channel_category() :: %Alchemy.Channel.ChannelCategory{
  guild_id: snowflake(),
  id: snowflake(),
  name: String.t(),
  nsfw: Boolean.t(),
  permission_overwrites: [overwrite()],
  position: Integer
}

Represents a channel category in a guild.

  • id

    The id of this category

  • guild_id

    The of the guild this category belongs to

  • position

    The sorting position of this category

  • permission_overwrites

    An array of permission overwrites

  • name

    The name of this category

  • nsfw

    Whether or not this category is considered nsfw

Specs

datetime() :: String.t()
Link to this type

dm_channel()

Specs

dm_channel() :: %Alchemy.Channel.DMChannel{
  id: snowflake(),
  last_message_id: snowflake() | nil,
  recipients: [Alchemy.User.t()]
}

Represents a private message between the bot and another user.

  • id

    The id of this channel

  • recipients

    A list of users receiving this channel

  • last_message_id

    The id of the last message sent, if any

Link to this type

group_dm_channel()

Specs

group_dm_channel() :: %Alchemy.Channel.GroupDMChannel{
  icon: String.t() | nil,
  id: snowflake(),
  last_message_id: snowflake() | nil,
  name: String.t(),
  owner_id: snowflake(),
  recipients: [Alchemy.User.t()]
}

Represents a dm channel between multiple users.

  • id

    The id of this channel

  • owner_id

    The id of the owner of this channel

  • icon

    The hash of the image icon for this channel, if it has one

  • name

    The name of this channel

  • recipients

    A list of recipients of this channel

  • last_message_id The id of the last message sent in this channel, if any

Specs

hash() :: String.t()

Specs

invite() :: %Alchemy.Channel.Invite{
  channel: invite_channel(),
  code: String.t(),
  created_at: datetime(),
  guild: invite_guild(),
  inviter: Alchemy.User.t(),
  max_age: Integer,
  max_uses: Integer,
  revoked: Boolean,
  temporary: Boolean,
  uses: Integer
}

Represents an Invite object along with the metadata.

  • code

    The unique invite code

  • guild

    The guild this invite is for

  • channel

    The channel this invite is for

  • inviter

    The user who created the invite

  • uses

    The amount of time this invite has been used

  • max_uses

    The max number of times this invite can be used

  • max_age

    The duration (seconds) after which the invite will expire

  • temporary

    Whether this invite grants temporary membership

  • created_at

    When this invite was created

  • revoked

    Whether this invite was revoked

Link to this type

invite_channel()

Specs

invite_channel() :: %Alchemy.Channel.Invite.InviteChannel{
  id: snowflake(),
  name: String.t(),
  type: String.t()
}

Represents the channel an invite is for

  • id

    The id of the channel

  • name

    The name of the channel

  • type

    The type of the channel, either "text" or "voice"

Link to this type

invite_guild()

Specs

invite_guild() :: %Alchemy.Channel.Invite.InviteGuild{
  icon: hash(),
  id: snowflake(),
  name: String.t(),
  splash: hash()
}

Represents the guild an invite is for.

  • id

    The id of the guild

  • name

    The name of the guild

  • splash

    The hash of the guild splash (or nil)

  • icon

    The hash of the guild icon (or nil)

Specs

overwrite() :: %Alchemy.OverWrite{
  allow: Integer,
  deny: Integer,
  id: String.t(),
  type: String.t()
}

Represents a permission OverWrite object

  • id

    role or user id

  • type

    either "role", or "member"

  • allow

    the bit set of that permission

  • deny

    the bit set of that permission

Specs

snowflake() :: String.t()

Specs

The general channel type, representing one of 5 variants.

The best way of dealing with this type is pattern matching against one of the 5 structs.

Link to this type

text_channel()

Specs

text_channel() :: %Alchemy.Channel.TextChannel{
  guild_id: snowflake(),
  id: snowflake(),
  last_message_id: snowflake() | nil,
  last_pin_timestamp: String.t() | nil,
  name: String.t(),
  nsfw: Boolean.t(),
  parent_id: snowflake() | nil,
  permission_overwrites: [overwrite()],
  position: Integer,
  topic: String.t() | nil
}

Represents a normal text channel in a guild

_ id

The id of the channel

  • guild_id

    The id of the guild this channel belongs to

  • position

    The sorting position of this channel

  • permission_overwrites

    An array of %OverWrite{} structs

  • name

    The name of this channel

  • topic

    The topic of the channel

  • nsfw

    Whether or not the channel is considered nsfw

  • last_message_id

    The id of the last message sent in the channel, if any

  • parent_id

    The id of the category this channel belongs to, if any

  • last_pin_timestamp

    The timestamp of the last channel pin, if any

Link to this type

voice_channel()

Specs

voice_channel() :: %Alchemy.Channel.VoiceChannel{
  bitrate: Integer,
  guild_id: snowflake(),
  id: snowflake(),
  name: String.t(),
  nsfw: Boolean.t(),
  parent_id: snowflake() | nil,
  permission_overwrites: [overwrite()],
  position: Integer,
  user_limit: Integer
}

Represents a voice channel in a guild.

  • id

    The id of this channel

  • guild_id

    The id of the guild this channel belongs to

  • position

    The sorting position of this channel in the guild

  • permission_overwrites

    An array of permission overwrites for this channel

  • name

    The name of this channel

  • nsfw

    Whether or not this channel is considered nsfw

  • bitrate

    The bitrate for this channel

  • user_limit

    The max amount of users in this channel, 0 for no limit

  • parent_id

    The id of the category this channel belongs to, if any