Represents a Discord message.
Summary
Functions
Applies a changeset to a message. No-op if the changeset has no changes.
Adds a change to an existing changeset for this entity.
Creates a changeset for batching mutations to this entity.
Deletes a message.
Edits a message. Accepts a struct or channel_id + message_id.
Fetches a message by channel ID and message ID. No cache (messages are not cached).
Pins a message in its channel.
Adds a reaction to a message.
Replies to a message. Returns a %EDA.Message{} struct.
Unpins a message from its channel.
Types
@type t() :: %EDA.Message{ attachments: [EDA.Attachment.t()] | nil, author: EDA.User.t() | nil, channel_id: String.t() | nil, components: [map()] | nil, content: String.t() | nil, edited_timestamp: String.t() | nil, embeds: [map()] | nil, guild_id: String.t() | nil, id: String.t() | nil, member: EDA.Member.t() | nil, mention_everyone: boolean() | nil, mention_roles: [String.t()] | nil, mentions: [EDA.User.t()] | nil, message_reference: map() | nil, pinned: boolean() | nil, poll: EDA.Poll.t() | nil, reactions: [EDA.Reaction.t()] | nil, referenced_message: t() | nil, sticker_items: [map()] | nil, timestamp: String.t() | nil, tts: boolean() | nil, type: integer() | nil }
Functions
@spec apply_changeset( EDA.Entity.Changeset.t(), keyword() ) :: {:ok, t()} | {:error, term()}
Applies a changeset to a message. No-op if the changeset has no changes.
@spec change(EDA.Entity.Changeset.t(), atom(), term()) :: EDA.Entity.Changeset.t()
Adds a change to an existing changeset for this entity.
@spec changeset(t()) :: EDA.Entity.Changeset.t()
Creates a changeset for batching mutations to this entity.
Deletes a message.
Options
:reason- Audit log reason
Edits a message. Accepts a struct or channel_id + message_id.
@spec fetch_message(String.t() | integer(), String.t() | integer()) :: {:ok, t()} | {:error, term()}
Fetches a message by channel ID and message ID. No cache (messages are not cached).
Pins a message in its channel.
Options
:reason- Audit log reason
@spec react(t(), String.t() | EDA.Emoji.t()) :: :ok | {:error, term()}
Adds a reaction to a message.
The emoji parameter accepts a string ("👍" or "name:id") or an EDA.Emoji struct.
Replies to a message. Returns a %EDA.Message{} struct.
Unpins a message from its channel.
Options
:reason- Audit log reason