alchemy v0.6.0 Alchemy.Message
This module contains the types and functions related to messages in discord.
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
Types
emoji :: %Alchemy.Reaction.Emoji{id: String.t | nil, name: String.t}
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.
mention_type :: :roles | :nicknames | :channels | :users
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.
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.
Functions
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.