Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/denocordts/src/structures/messages/Base.ts>BaseMessage

An Object Oriented Discord API wrapper for Deno.
Latest
class BaseMessage
import { BaseMessage } from "https://deno.land/x/denocordts@1.2.0/src/structures/messages/Base.ts";

Properties

optional
activity: APIMessage["activity"]
optional
application: APIMessage["application"]
optional
application_id: Snowflake

If the message is a response to an Interaction, this is the id of the interaction's application

author: User

The author of this message (only a valid user in the case where the message is generated by a user or bot user)

If the message is generated by a webhook, the author object corresponds to the webhook's id, username, and avatar. You can tell if a message is generated by a webhook by checking for the webhook_id property

See https://discord.com/developers/docs/resources/user#user-object

channelId: Snowflake

ID of the channel the message was sent in

optional
components: APIMessage["components"]

Sent if the message contains components like buttons, action rows, or other interactive components

content: string

Contents of the message

createdAt: number

Time in Milliseconds at which this message was created.

editedTimestamp: string | null

When this message was edited (or null if never)

optional
guild: Guild

The Guild Where Message is created.

optional
guildId: Snowflake

ID of the channel the message was sent in

Id of the Message

optional
interaction: APIMessage["interaction"]

Sent if the message is a response to an Interaction

optional
member: GuildMember

Member properties for this message's author

The member object exists in MESSAGE_CREATE and MESSAGE_UPDATE events from text-based guild channels

See https://discord.com/developers/docs/resources/guild#guild-member-object

optional
mentionChannels: APIMessage["mention_channels"]

Channels specifically mentioned in this message

Not all channel mentions in a message will appear in mention_channels.

  • Only textual channels that are visible to everyone in a lurkable guild will ever be included
  • Only crossposted messages (via Channel Following) currently include mention_channels at all

If no mentions in the message meet these requirements, this field will not be sent

See https://discord.com/developers/docs/resources/channel#channel-mention-object

mentionEveryone: boolean

Whether this message mentions everyone

mentionRoles: APIMessage["mention_roles"]

Roles specifically mentioned in this message

See https://discord.com/developers/docs/topics/permissions#role-object

mentions: APIMessage["mentions"]

Users specifically mentioned in the message

The member field is only present in MESSAGE_CREATE and MESSAGE_UPDATE events from text-based guild channels

See https://discord.com/developers/docs/resources/user#user-object See https://discord.com/developers/docs/resources/guild#guild-member-object

optional
messageReference: APIMessage["message_reference"]

Reference data sent with crossposted messages, replies, pins, and thread starter messages

See https://discord.com/developers/docs/resources/channel#message-object-message-reference-structure

optional
nonce: APIMessage["nonce"]

A nonce that can be used for optimistic message sending (up to 25 characters)

You will not receive this from further fetches. This is received only once from a MESSAGE_CREATE event to ensure it got sent

pinned: boolean

Whether this message is pinned

optional
reactions: APIMessage["reactions"]
optional
referencedMessage: APIMessage["referenced_message"]

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

See https://discord.com/developers/docs/resources/channel#message-object

optional
stickerItems: APIMessage["sticker_items"]
optional
thread: APIMessage["thread"]

Sent if a thread was started from this message

timestamp: string

When this message was sent

tts: boolean

Whether this was a TTS message

optional
webhookId: Snowflake

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

Methods

private
checks(payload: ReplyPayload)
addReaction(emoji: string)
createNewThread(reason?: string)
delete(reason?: string)
getReactions(emoji: string)
pinMessage(reason?: string)
removeClientReaction(emoji: string)
removeUserReaction(emoji: string, userId: Snowflake)
reply(payload: ReplyPayload & { ping?: boolean; inline?: boolean; })
startThreadFromMessage(reason?: string)
unpinMessage(reason?: string)