The base of all structures in this library. All structures that have an ID will extend this class.

Hierarchy

Constructors

Properties

_createdAt: number

The timestamp that the message was created at.

_deletedAt: null | number = null

When the message was deleted, if it was

_updatedAt: null | number

The timestamp that the message was updated at, if relevant

channelId: string

The ID of the channel

client: Client
content: string

The content of the message

createdById: string

The ID of the user who created this message (Note: If this event has createdByBotId or createdByWebhookId present, this field will still be populated, but can be ignored. In these cases, the value of this field will always be Ann6LewA)

createdByWebhookId: null | string

The ID of the webhook who created this message, if it was created by a webhook

deleted: boolean = false

Whether the message has been deleted

embeds: Embed[] = []

Embeds contained within this message

groupId: null | string

The ID of the group this message was posted in

id: string

Identifier of this structrure

isPrivate: boolean

If set, this message will only be seen by those mentioned or replied to.

isReply: boolean

Bool value to wether message is a reply or not

isSilent: boolean

If set, this message did not notify, mention or reply recipients.

mentions?: MentionsPayload

The mentions within this message

Bare data of this structure

replyMessageIds: string[] = []

The ID of the messages that this is replying to.

serverId: null | string

The ID of the server this message belongs to

The type of chat message. "system" messages are generated by Guilded, while "default" messages are user or bot-generated.

Accessors

Methods

  • Add a reaction emote.

    Parameters

    • emoteId: number

      The ID of the emote to add.

    Returns Promise<void>

    A promise that resolves when the emote has been added.

  • Deletes either a whole reaction emote from a message or a specific user's if a userId is provided.

    Parameters

    • emoteId: number

      The ID of the emote to delete.

    • Optional userId: string

    Returns Promise<void>

    A promise that resolves when the emote has been deleted.

  • Send a message that replies to this message. It mentions the user who sent this message.

    Example

    let replyObj = {
    content: 'This is text, supports **markdown**.',
    embeds: [{
    title: 'This is an embed title!',
    description: 'A description may go here'
    }]
    };
    message.reply(replyObj)

    Parameters

    Returns Promise<Message>

  • Send a message in the same channel as this message.

    Example

    let replyObj = {
    content: 'This is text, supports **markdown**.',
    embeds: [{
    title: 'This is an embed title!',
    description: 'A description may go here'
    }]
    };
    message.send(replyObj)

    Parameters

    Returns Promise<Message>

Generated using TypeDoc