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
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
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
datetime()
Specs
datetime() :: String.t()
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
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
hash()
Specs
hash() :: String.t()
invite()
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
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"
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
)
overwrite()
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
snowflake()
Specs
snowflake() :: String.t()
Specs
t() :: text_channel() | voice_channel() | channel_category() | dm_channel() | group_dm_channel()
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.
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{}
structsname
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
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 limitparent_id
The id of the category this channel belongs to, if any