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.
idThe id of this category
guild_idThe of the guild this category belongs to
positionThe sorting position of this category
permission_overwritesAn array of permission overwrites
nameThe name of this category
nsfwWhether 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.
idThe id of this channel
recipientsA list of users receiving this channel
last_message_idThe 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.
idThe id of this channel
owner_idThe id of the owner of this channel
iconThe hash of the image icon for this channel, if it has one
nameThe name of this channel
recipientsA list of recipients of this channel
last_message_idThe 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.
codeThe unique invite code
guildThe guild this invite is for
channelThe channel this invite is for
inviterThe user who created the invite
usesThe amount of time this invite has been used
max_usesThe max number of times this invite can be used
max_ageThe duration (seconds) after which the invite will expire
temporaryWhether this invite grants temporary membership
created_atWhen this invite was created
revokedWhether 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
idThe id of the channel
nameThe name of the channel
typeThe 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.
idThe id of the guild
nameThe name of the guild
splashThe hash of the guild splash (or
nil)iconThe 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
idrole or user id
typeeither "role", or "member"
allowthe bit set of that permission
denythe 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_idThe id of the guild this channel belongs to
positionThe sorting position of this channel
permission_overwritesAn array of
%OverWrite{}structsnameThe name of this channel
topicThe topic of the channel
nsfwWhether or not the channel is considered nsfw
last_message_idThe id of the last message sent in the channel, if any
parent_idThe id of the category this channel belongs to, if any
last_pin_timestampThe 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.
idThe id of this channel
guild_idThe id of the guild this channel belongs to
positionThe sorting position of this channel in the guild
permission_overwritesAn array of permission overwrites for this channel
nameThe name of this channel
nsfwWhether or not this channel is considered nsfw
bitrateThe bitrate for this channel
user_limitThe max amount of users in this channel,
0for no limitparent_idThe id of the category this channel belongs to, if any