Remedy.Struct.Message (Remedy v0.5.2) 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.

Functions

Takes the message and produces a URL that, when clicked from the user client, will jump them to that message, assuming they have access to the message and the message is valid.

Link to this section Types

Specs

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

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

Specs

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

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

Specs

attachments() :: [Remedy.Struct.Message.Attachment.t()]

List of attached files in the message

Specs

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

The user struct of the author

Specs

channel_id() :: Remedy.Struct.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() :: [Remedy.Struct.Embed.t()]

List of embedded content in the message

Specs

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

The id of the guild

Specs

id() :: Remedy.Snowflake.t()

The id of the message

Specs

member() :: Remedy.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() :: [Remedy.Struct.Guild.Role.id()]

List of roles ids mentioned in the message

Specs

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

List of users mentioned in the message

Specs

message_reference() :: Remedy.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() :: [Remedy.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() :: %Remedy.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() :: Remedy.Snowflake.t() | nil

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

Link to this section Functions

Link to this function

to_url(msg)

View Source (since 0.5.0)

Specs

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

Takes the message and produces a URL that, when clicked from the user client, will jump them to that message, assuming they have access to the message and the message is valid.