Class Message<T>

Represents a guild message.

Type Parameters

Hierarchy

  • Base<string>
    • Message

Constructors

Properties

_lastMessageID: null | string

ID of the last message created with the message itself.

channelID: string

ID of the channel on which the message was sent.

client: Client

Bot's client.

content: null | string

Content of the message.

createdAt: Date

When the message was created.

deletedAt: null | Date

When the message was deleted.

editedTimestamp: null | Date

Timestamp at which this message was last edited.

embeds?: APIEmbedOptions[] | []

Array of message embed.

guildID: null | string

ID of the server on which the message was sent.

id: string

Item ID

isPrivate: boolean

If true, the message appears as private.

isSilent: boolean

If true, the message didn't mention anyone.

memberID: string

ID of the message author.

mentions: APIMentions

object containing all mentioned users.

replyMessageIds: string[]

The IDs of the message replied by the message.

type: string

Message type.

webhookID?: null | string

ID of the webhook used to send this message. (if sent by a webhook)

Accessors

  • get member(): T extends Guild ? Member : undefined | Member | Promise<Member>
  • Retrieve message's member.

    Make sure to await this property (getter) to still get results even if the member is not cached.

    Note

    The API does not provide member information, that's why you might need to await this property.

    Returns T extends Guild ? Member : undefined | Member | Promise<Member>

Methods

  • Add a reaction to this message.

    Parameters

    • reaction: number

      ID of a reaction/emote.

    Returns Promise<void>

  • Delete the last message sent with the message itself.

    Returns Promise<void>

  • Remove a reaction from this message.

    Parameters

    • reaction: number

      ID of a reaction/emote.

    Returns Promise<void>