Creates a new Message instance.
The client instance.
The raw data for the message from the API.
Optional
attachments?: Optional
content?: null | stringOptional
edited?: null | stringOptional
embeds?: Optional
flags?: numberFormat: uint32
Bitfield of message flags
https://docs.rs/revolt-models/latest/revolt_models/v0/enum.MessageFlags.html
Optional
interactions?: { reactions?: null | string[]; restrict_reactions?: boolean }Optional
reactions?: null | string[]Optional
restrict_reactions?: booleanOptional
masquerade?: null | { avatar?: null | string; colour?: null | string; name?: null | string }Optional
member?: Optional
mentions?: null | string[]Optional
nonce?: null | stringOptional
pinned?: null | booleanOptional
reactions?: { [key: string]: string[] }Optional
replies?: null | string[]Optional
system?: Optional
user?: Optional
webhook?: null | { avatar?: null | string; name: string }An array of file attachments included in the message.
Optional
deleted?: null | booleanOptional
message_id?: null | stringOptional
object_id?: null | stringOptional
reported?: null | booleanOptional
server_id?: null | stringFormat: int
Optional
user_id?: null | stringThe ID of the user who authored the message.
The ID of the channel where the message was sent.
Readonly
clientThe client instance.
The content of the message.
The timestamp of when the message was last edited, or null
if not edited.
An array of embeds included in the message.
Optional
colour?: null | stringOptional
description?: null | stringOptional
icon_url?: null | stringOptional
image?: null | { height: number; size: "Large" | "Preview"; url: string; width: number }Optional
original_url?: null | stringOptional
site_name?: null | stringOptional
special?: Optional
title?: null | stringOptional
url?: null | stringOptional
video?: null | { height: number; url: string; width: number }Format: uint
Format: uint
Format: uint
Format: uint
Optional
colour?: null | stringOptional
description?: null | stringOptional
icon_url?: null | stringOptional
media?: Optional
title?: null | stringOptional
url?: null | stringThe unique identifier for the object.
Mentions included in the message.
the reactions and count on a message
The type of the message (e.g., TEXT, SYSTEM).
Retrieves the author of the message.
The user who authored the message, or null
if not found.
Retrieves the channel where the message was sent.
The channel instance.
Gets the creation timestamp of the message in milliseconds.
The timestamp of when the message was created.
Gets the date when the message was last edited.
The date of the last edit, or null
if not edited.
Retrieves the server member who authored the message, if any.
The server member instance, or null
if not found.
Retrieves the server associated with the message, if any.
The server instance, or null
if not found.
Retrieves the server ID associated with the message, if any.
The server ID, or null
if the message is not in a server.
Checks if the message is a system message.
true
if the message is a system message, otherwise false
.
Gets the URL of the message.
The URL of the message.
Creates a deep clone of the object.
A clone of the object.
Updates the object with new data and returns a clone of the object.
The data to update the object with.
Optional
clear: string[]Fields to clear in the object.
A clone of the updated object.
Acknowledges the message.
A promise that resolves when the message is acknowledged.
Adds a reaction to the message.
The emoji to react with.
A promise that resolves when the reaction is added.
Edits the message.
The new content or edit options.
A promise that resolves when the message is edited.
Compares this object with another to determine if they are equal.
Optional
obj: null | MessageThe object to compare with.
true
if the objects are equal, otherwise false
.
Checks if the message is in a server.
true
if the message is in a server, otherwise false
.
Removes all reactions from the message.
A promise that resolves when all reactions are removed.
Removes a reaction from the message.
The emoji to remove the reaction for.
Optional
options: { remove_all?: boolean; user_id?: string }Options for removing the reaction.
Optional
remove_all?: booleanWhether to remove all of the specified reaction for the message.
Optional
user_id?: stringThe user ID to remove the reaction for. If not provided, removes the reaction for the current user.
A promise that resolves when the reaction is removed.
Converts the message to a string representation.
The content of the message.
Represents a message in a channel.