: stringText content of the message.
A message in a channel.
Extends Base
(client: Client, data: APIMessage)Construct a message from API data.
| Param | Type | Description |
|---|---|---|
| client | Client | |
| data | APIMessage | API message from REST or MESSAGE_CREATE |
: Collection<string, APIMessageAttachment> (readonly)Attached files (images, videos, etc.).
: APIMessageCall | null (readonly)Call data if this message represents a call event.
: (TextChannel | DMChannel | GuildChannel) | null (readonly)Cached text/DM/guild channel, or null if uncached.
: string (readonly)Channel ID where this message was sent.
: stringText content of the message.
: Date (readonly)When the message was created.
: Date | null (readonly)When the message was last edited, or null if never edited.
: APIEmbed[] (readonly)Embedded content (rich previews, etc.).
: number (readonly)Message flags bitfield.
: Guild | null (readonly)Cached guild, or null for DMs / uncached.
: string | null (readonly)Guild ID if in a guild channel, null for DMs.
: string (readonly)Snowflake ID of this message.
: boolean (readonly)Whether `@everyone` or `@here` was mentioned.
: string[] (readonly)Role IDs mentioned in the message.
: User[] (readonly)Users mentioned in the message.
: APIMessageReference | null (readonly)Reference to a replied-to message, if any.
: APIMessageSnapshot[] (readonly)Message snapshots for forwarded messages.
: string | null (readonly)Client-side nonce for deduplication.
: booleanWhether the message is pinned.
: APIMessageReaction[] (readonly)Reactions on the message.
: Message | null (readonly)The full referenced (replied-to) message, or null.
: APIMessageSticker[] (readonly)Stickers sent with the message.
: boolean (readonly)Whether this is a text-to-speech message.
: MessageType (readonly)Message type (Default, Reply, etc.).
: string | null (readonly)Webhook ID if sent by a webhook.
(options?: ReactionCollectorOptions): ReactionCollectorCreate a ReactionCollector for this message.
| Param | Type | Description |
|---|---|---|
| options? | ReactionCollectorOptions |
(): Promise<void>Delete this message.
(attachmentId: string): Promise<void>Delete a specific attachment from this message.
| Param | Type | Description |
|---|---|---|
| attachmentId | string |
(options: MessageEditOptions): Promise<Message>Edit this message (requires author or admin permissions).
| Param | Type | Description |
|---|---|---|
| options | MessageEditOptions |
(): Promise<Message>Fetch the latest version of this message from the API.
(emoji: EmojiInput, options?: { limit?: number; after?: string; }): Promise<User[]>Fetch users who reacted with a specific emoji.
| Param | Type | Description |
|---|---|---|
| emoji | EmojiInput | |
| options? | { limit?: number; after?: string; } |
(emoji: EmojiInput, options?: { limit?: number; after?: string; }): Promise<{ users: User[]; hasMore: boolean; nextAfter: string | null }>Fetch reaction users with pagination metadata.
| Param | Type | Description |
|---|---|---|
| emoji | EmojiInput | |
| options? | { limit?: number; after?: string; } |
(): Promise<void>Pin this message in the channel.
(emoji: EmojiInput): Promise<void>React to this message with an emoji.
| Param | Type | Description |
|---|---|---|
| emoji | EmojiInput |
(): Promise<void>Remove all reactions from this message.
(emoji: EmojiInput, userId?: string): Promise<void>Remove a reaction (bot's own or a user's if ID is provided).
| Param | Type | Description |
|---|---|---|
| emoji | EmojiInput | |
| userId? | string |
(emoji: EmojiInput): Promise<void>Remove all reactions of a specific emoji.
| Param | Type | Description |
|---|---|---|
| emoji | EmojiInput |
(options: string | (MessageSendOptions & ReplyOptions), replyOptions?: ReplyOptions): Promise<Message>Reply to this message.
| Param | Type | Description |
|---|---|---|
| options | string | (MessageSendOptions & ReplyOptions) | |
| replyOptions? | ReplyOptions |
(): Promise<Channel>Fetch and resolve the channel this message is in.
(): Promise<Guild | null>Fetch and resolve the guild, or null if a DM.
(options: MessagePrepareInput): Promise<Message>Send a message in this channel without replying.
| Param | Type | Description |
|---|---|---|
| options | MessagePrepareInput |
(channelId: string, options: MessagePrepareInput): Promise<Message>Send a message to another channel by ID.
| Param | Type | Description |
|---|---|---|
| channelId | string | |
| options | MessagePrepareInput |
(): Promise<void>Unpin this message from the channel.