Results

Namespace

Type

Hierarchy

  • Message
    • GuildMemberMessage <-- You are here!

Index

Type aliases

Static AnyMessage

A type alias to describe any message class type.

Static OutgoingMessage

OutgoingMessage: string | OutgoingMessageOptions | Embed

A type alias to describe possible outgoing message types.

Static OutgoingMessageArgument

OutgoingMessageArgument<T>: T | Promise<T> | function

A type alias to describe the possible configurations to use when sending a message.

If a Promise-like type is used, the bot will send a typing indicator for the channel before resolving the Promise and sending its content.

Type parameters

Static OutgoingMessageOptions

OutgoingMessageOptions: IOutgoingMessageOptions & object | object | object | object

A type-alias used to describe the possible options for message content. See discord.Message.IOutgoingMessageOptions for a full list of options.

Properties

Readonly activity

activity: IMessageActivity | null

The activity object included with this message, if set.

Readonly application

application: IMessageApplication | null

The application metadata used to render activity data for a message, if set.

Readonly attachments

An array of attachments sent with this message.

Readonly author

author: User

The author of this message. Always set for messages of this type.

Readonly channelId

channelId: Snowflake

The id of the text channel this message was sent in.

Note: You can fetch the full channel data with discord.Message.getChannel.

Readonly content

content: string

The text content of this message.

May contain up to 2000 characters.

Readonly editedTimestamp

editedTimestamp: string | null

The timestamp at which the message was last edited at, in ISO-8601 format.

Readonly embeds

embeds: Array<Embed>

An array of embeds included with this message.

Readonly flags

flags: Flags | null

A bit set of flags containing more information for this message.

Readonly guildId

guildId: Snowflake

The id of the guild this message was sent in. Always set for messages of this type.

Note: You can fetch the full guild data with discord.Message.getGuild.

Readonly id

The unique id for this message. The id can be used to find the time the message was created.

Readonly member

member: GuildMember

The guild member who authored this message. Always set for messages of this type.

Readonly mentionChannels

mentionChannels: Array<IMessageChannelMention>

An array of partial channel objects mentioned in this channel.

Readonly mentionEveryone

mentionEveryone: boolean

true if this message mentions everyone.

Readonly mentionRoles

mentionRoles: Array<Snowflake>

An array of role ids mentioned in this channel.

Readonly mentions

mentions: Array<User & object>

An array of user objects, containing partial member objects, of users mentioned in this message.

Readonly messageReference

messageReference: IMessageReference | null

The original message reference for cross-posted announcement messages.

Readonly pinned

pinned: boolean

true if this message is pinned to the channel.

Readonly reactions

An array of emoji reactions added to this message.

Readonly timestamp

timestamp: string

The timestamp at which this message was sent at, in ISO-8601 format.

Readonly type

type: DEFAULT | REPLY

Messages of this type are always Message.Type.DEFAULT or Message.Type.REPLY.

Readonly webhookId

webhookId: null

The webhook id that created this message. Always null for messages of this type.

Methods

addReaction

  • addReaction(emoji: string | IEmoji): Promise<void>
  • Reacts to this message with the specified emoji.

    If an error occurred, a discord.ApiError exception is thrown.

    Parameters

    • emoji: string | IEmoji

      If passing a string, use a raw unicode emoji like ✅, or a custom emoji in the format of name:id.

    Returns Promise<void>

delete

  • delete(): Promise<void>
  • Attempts to permanently delete this message.

    If an error occurred, a discord.ApiError exception is thrown.

    Returns Promise<void>

deleteAllReactions

deleteAllReactionsForEmoji

  • deleteAllReactionsForEmoji(emoji: string | IEmoji): Promise<void>
  • Deletes all reactions for the emoji specified on this message.

    If an error occurred, a discord.ApiError exception is thrown.

    Parameters

    • emoji: string | IEmoji

      If passing a string, use a raw unicode emoji like ✅, or a custom emoji in the format of name:id.

    Returns Promise<void>

deleteOwnReaction

  • deleteOwnReaction(emoji: string | IEmoji): Promise<void>
  • Deletes the bot user's own reaction to this message of the specified emoji.

    If an error occurred, a discord.ApiError exception is thrown.

    Parameters

    • emoji: string | IEmoji

      If passing a string, use a raw unicode emoji like ✅, or a custom emoji in the format of name:id.

    Returns Promise<void>

deleteReaction

  • deleteReaction(emoji: string | IEmoji, user: Snowflake | User): Promise<void>
  • Deletes a user's reaction to the message.

    If an error occurred, a discord.ApiError exception is thrown.

    Parameters

    • emoji: string | IEmoji

      If passing a string, use a raw unicode emoji like ✅, or a custom emoji in the format of name:id.

    • user: Snowflake | User

      A user id or reference to a user object.

    Returns Promise<void>

edit

  • edit(messageOptions: OutgoingMessageOptions | object): Promise<Message>
  • Attempts to edit a message. Messages may only be edited by their author.

    If you wish to remove an embed from the message, set the embed property to null. The message content may be set to an empty string only if the message has or is receiving an embed with the edit.

    Note: You may not modify allowedMentions or tts when editing a message, these only apply when a message is initially received.

    If an error occurred, a discord.ApiError exception is thrown.

    Parameters

    Returns Promise<Message>

    On success, the Promise resolves as the new message object.

  • edit(content: string): Promise<Message>
  • Attempts to edit a message. Replaces the content with the new provided content.

    Messages may only be edited if authored by the bot.

    Note: If you'd like more options (embeds, allowed mentions, etc) see discord.Message.OutgoingMessageOptions.

    If an error occurred, a discord.ApiError exception is thrown.

    Parameters

    • content: string

      New content for this message.

    Returns Promise<Message>

    On success, the Promise resolves as the new message object.

  • edit(embed: Embed): Promise<Message>
  • Attempts to edit a message. Sets the content to an empty string and adds or updates the embed associated with this message.

    Messages may only be edited if authored by the bot.

    If an error occurred, a discord.ApiError exception is thrown.

    Parameters

    Returns Promise<Message>

    On success, the Promise resolves as the new message object.

getChannel

getGuild

  • getGuild(): Promise<Guild>
  • Fetches the data for the guild this message was sent in.

    If the message was not sent in a guild, the Promise resolves as null.

    Returns Promise<Guild>

inlineReply

iterReactions

reply

setPinned

  • setPinned(pinned: boolean): Promise<void>
  • Changes the pinned status of this message.

    Parameters

    • pinned: boolean

      true if the message should be pinned, otherwise false.

    Returns Promise<void>

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc