Nostrum.Struct.Message (Nostrum v0.4.6) View Source

Struct representing a Discord message.

Link to this section Summary

Types

The activity of the message. Sent with Rich Presence-related chat embeds.

The application of the message. Sent with Rich Presence-related chat embeds.

List of attached files in the message

The user struct of the author

The id of the channel

The content of the message

When the message was edited

List of embedded content in the message

The id of the guild

The id of the message

Partial Guild Member object received with the Message Create event if message came from a guild channel.

Whether this messsage mentions everyone

List of roles ids mentioned in the message

List of users mentioned in the message

Reference data sent with crossposted messages and replies

Validates if a message was sent

Whether this message is pinned

Reactions to the message.

The message associated with the message_reference

t()

When the message was sent

Whether this was a TTS message

If the message is generated by a webhook, this is the webhook's id.

Link to this section Types

Specs

activity() :: Nostrum.Struct.Message.Activity.t() | nil

The activity of the message. Sent with Rich Presence-related chat embeds.

Specs

application() :: Nostrum.Struct.Message.Application.t() | nil

The application of the message. Sent with Rich Presence-related chat embeds.

Specs

List of attached files in the message

Specs

author() :: Nostrum.Struct.User.t()

The user struct of the author

Specs

channel_id() :: Channel.id()

The id of the channel

Specs

content() :: String.t()

The content of the message

Specs

edited_timestamp() :: String.t() | nil

When the message was edited

Specs

embeds() :: [Nostrum.Struct.Embed.t()]

List of embedded content in the message

Specs

guild_id() :: Nostrum.Struct.Guild.id() | nil

The id of the guild

Specs

The id of the message

Specs

member() :: Nostrum.Struct.Guild.Member.t() | nil

Partial Guild Member object received with the Message Create event if message came from a guild channel.

Specs

mention_everyone() :: boolean()

Whether this messsage mentions everyone

Specs

mention_roles() :: [Nostrum.Struct.Guild.Role.id()]

List of roles ids mentioned in the message

Specs

mentions() :: [Nostrum.Struct.User.t()]

List of users mentioned in the message

Specs

message_reference() :: Nostrum.Struct.Message.Reference.t() | nil

Reference data sent with crossposted messages and replies

Specs

nonce() :: String.t() | nil

Validates if a message was sent

Specs

pinned() :: boolean()

Whether this message is pinned

Specs

reactions() :: [Nostrum.Struct.Message.Reaction.t()] | nil

Reactions to the message.

Specs

referenced_message() :: t() | nil

The message associated with the message_reference

This field is only returned for messages with a type of 19 (REPLY). If the message is a reply but the referenced_message field is not present, the backend did not attempt to fetch the message that was being replied to, so its state is unknown. If the field exists but is null, the referenced message was deleted.

Specs

t() :: %Nostrum.Struct.Message{
  activity: activity(),
  application: application(),
  attachments: attachments(),
  author: author(),
  channel_id: channel_id(),
  content: content(),
  edited_timestamp: edited_timestamp(),
  embeds: embeds(),
  guild_id: guild_id(),
  id: id(),
  member: member(),
  mention_everyone: mention_everyone(),
  mention_roles: mention_roles(),
  mentions: mentions(),
  message_reference: message_reference(),
  nonce: nonce(),
  pinned: pinned(),
  reactions: reactions(),
  referenced_message: referenced_message(),
  timestamp: timestamp(),
  tts: tts(),
  type: type(),
  webhook_id: webhook_id()
}

Specs

timestamp() :: String.t()

When the message was sent

Specs

tts() :: boolean()

Whether this was a TTS message

Specs

type() :: integer()

Type of message.

Specs

webhook_id() :: Nostrum.Snowflake.t() | nil

If the message is generated by a webhook, this is the webhook's id.