Alchemy.Message (alchemy v0.7.0)
This module contains the types and functions related to messages in discord.
Link to this section Summary
Types
Represents an emoji used to react to a message.
Represents a reaction to a message.
Represents a message in a channel.
Represents an iso8601 timestamp.
Functions
Finds a list of mentions in a string.
Link to this section Types
Link to this type
emoji()
Specs
Represents an emoji used to react to a message.
idThe id of this emoji.nilif this isn't a custom emoji.nameThe name of this emoji.
Link to this type
mention_type()
Specs
mention_type() :: :roles | :nicknames | :channels | :users
Link to this type
reaction()
Specs
reaction() :: %Alchemy.Reaction{
count: Integer,
emoji: Alchemy.Reaction.Emoji.t(),
me: Boolean
}
Represents a reaction to a message.
countTimes this specific emoji reaction has been used.meWhether this client reacted to the message.emojiInformation about the emoji used.
Link to this type
snowflake()
Specs
snowflake() :: String.t()
Specs
t() :: %Alchemy.Message{
attachments: [Alchemy.Attachment.t()],
author: Alchemy.User.t(),
channel_id: snowflake(),
content: String,
edited_timestamp: String | nil,
embeds: [Alchemy.Embed.t()],
id: snowflake(),
mention_everyone: Boolean,
mention_roles: [snowflake()],
mentions: [Alchemy.User.t()],
nonce: snowflake(),
pinned: Boolean,
reactions: [Alchemy.Reaction.t()],
timestamp: timestamp(),
tts: Boolean,
webhook_id: String.t() | nil
}
Represents a message in a channel.
idThe id of this message.authorThe user who sent this message. This field will be very incomplete if the message originated from a webhook.contentThe content of the message.timestampThe timestamp of the message.edit_timestampThe timestamp of when this message was edited, if it ever was.ttsWhether this was a tts message.mention_everyoneWhether this message mentioned everyone.mentionsA list of users this message mentioned.mention_rolesA list of role ids this message mentioned.attachmentsA list of attachments to the message.embedsA list of embeds attached to this message.reactionsA list of reactions to this message.nonceUsed for validating a message was sent.pinnedWhether this message is pinned.webhook_idThe id of the webhook that sent this message, if it was sent by a webhook.
Link to this type
timestamp()
Specs
timestamp() :: String.t()
Represents an iso8601 timestamp.
Link to this section Functions
Link to this function
find_mentions(content, type)
Specs
find_mentions(String.t(), mention_type()) :: [snowflake()]
Finds a list of mentions in a string.
4 types of mentions exist:
rolesA mention of a specific role.nicknamesA mention of a user by nickname.usersA mention of a user by name, or nickname.:channelsA mention of a channel.