Skip to main content

Class: Message

Hierarchy

  • Base

    Message

Constructors

constructor

new Message(app, raw)

Parameters

NameType
appApp
rawAPIMessage & { guild_id?: string }

Overrides

Base.constructor

Defined in

packages/disploy/src/structs/Message.ts:196

Properties

activity

Optional Readonly activity: APIMessageActivity

The activity present in the message.

Defined in

packages/disploy/src/structs/Message.ts:127


app

app: App

Inherited from

Base.app

Defined in

packages/disploy/src/structs/Base.ts:4


application

Optional Readonly application: Partial<APIApplication>

The associated application of the message.

Defined in

packages/disploy/src/structs/Message.ts:132


applicationId

Optional Readonly applicationId: string

The ID of the associated application of the message.

Defined in

packages/disploy/src/structs/Message.ts:137


attachments

Readonly attachments: APIAttachment[]

The attachments present in the message.

Defined in

packages/disploy/src/structs/Message.ts:92


author

Readonly author: User

The user that sent the message.

Defined in

packages/disploy/src/structs/Message.ts:52


channelId

Readonly channelId: string

The ID of the channel the message was sent in.

Defined in

packages/disploy/src/structs/Message.ts:47


components

Readonly components: APIActionRowComponent<APIMessageActionRowComponent>[]

The components in this message.

Defined in

packages/disploy/src/structs/Message.ts:167


content

Readonly content: string

The content of the message.

Defined in

packages/disploy/src/structs/Message.ts:42


editedTimestamp

Readonly editedTimestamp: null | number

The timestamp of when the message was last edited.

Defined in

packages/disploy/src/structs/Message.ts:62


embeds

Readonly embeds: APIEmbed[]

The embeds present in the message.

Defined in

packages/disploy/src/structs/Message.ts:97


flags

Optional Readonly flags: MessageFlags

The flags of the message.

Defined in

packages/disploy/src/structs/Message.ts:147


guild

Readonly guild: null | ToBeFetched<Guild>

The guild the message was sent in. (if sent in a guild)

Defined in

packages/disploy/src/structs/Message.ts:37


id

Readonly id: string

The ID of the message.

Defined in

packages/disploy/src/structs/Message.ts:32


interaction

Optional Readonly interaction: APIMessageInteraction

The interaction of the message.

Defined in

packages/disploy/src/structs/Message.ts:157


mentionChannels

Readonly mentionChannels: APIChannelMention[]

The channels mentioned in this message.

Defined in

packages/disploy/src/structs/Message.ts:87


mentionEveryone

Readonly mentionEveryone: boolean

Whether the message mentions everyone.

Defined in

packages/disploy/src/structs/Message.ts:72


mentionedRoles

Readonly mentionedRoles: string[]

The roles mentioned in this message.

Defined in

packages/disploy/src/structs/Message.ts:82


mentions

Readonly mentions: User[]

The users mentioned in the message.

Defined in

packages/disploy/src/structs/Message.ts:77


messageReference

Optional Readonly messageReference: APIMessageReference

The message reference of the message.

Defined in

packages/disploy/src/structs/Message.ts:142


nonce

Optional Readonly nonce: string | number

The nonce of the message.

Defined in

packages/disploy/src/structs/Message.ts:107


pinned

Readonly pinned: boolean

Whether the message is pinned in it's channel.

Defined in

packages/disploy/src/structs/Message.ts:112


reactions

Optional Readonly reactions: APIReaction[]

The reactions present in the message.

Defined in

packages/disploy/src/structs/Message.ts:102


referencedMessage

Optional Readonly referencedMessage: Message

The reference to the message.

Defined in

packages/disploy/src/structs/Message.ts:152


stickerItems

Readonly stickerItems: APIStickerItem[]

The stickers in this message.

Defined in

packages/disploy/src/structs/Message.ts:172


thread

Optional Readonly thread: APIChannel

The thread started by the message.

Defined in

packages/disploy/src/structs/Message.ts:162


timestamp

Readonly timestamp: number

The timestamp of when the message was sent.

Defined in

packages/disploy/src/structs/Message.ts:57


tts

Readonly tts: boolean

Whether the message is a TTS message.

Defined in

packages/disploy/src/structs/Message.ts:67


type

Readonly type: MessageType

The type of the message.

Defined in

packages/disploy/src/structs/Message.ts:122


webhookId

Optional Readonly webhookId: string

The webhook ID of the message.

Defined in

packages/disploy/src/structs/Message.ts:117

Methods

delete

delete(): Promise<null>

Deletes the message.

Throws

If the message is not deletable by the logged in application.

Returns

Promise<null>

Defined in

packages/disploy/src/structs/Message.ts:258


edit

edit(payload): Promise<Message>

Edits the message.

Parameters

NameTypeDescription
payloadAddUndefinedToPossiblyUndefinedPropertiesOfInterface<{ allowed_mentions?: null | APIAllowedMentions ; attachments?: Pick<APIAttachment, "id"> & Partial<Pick<APIAttachment, "description" | "filename">>[] ; components?: null | APIActionRowComponent<APIMessageActionRowComponent>[] ; content?: null | string ; embeds?: null | APIEmbed[] ; flags?: null | MessageFlags }>The payload to patch.

Returns

Promise<Message>

The edited message.

Defined in

packages/disploy/src/structs/Message.ts:268


reply

reply(payload): Promise<Message>

Replies to the message.

Parameters

NameTypeDescription
payloadOmit<AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{ allowed_mentions?: APIAllowedMentions ; attachments?: Pick<APIAttachment, "id" | "description"> & Partial<Pick<APIAttachment, "filename">>[] ; components?: APIActionRowComponent<APIMessageActionRowComponent>[] ; content?: string ; embeds?: APIEmbed[] ; flags?: MessageFlags ; message_reference?: APIMessageReferenceSend ; nonce?: string | number ; sticker_ids?: [string, string, string] | [string] | [string, string] ; tts?: boolean }>, "message_reference">The payload to send.

Returns

Promise<Message>

The created message.

Defined in

packages/disploy/src/structs/Message.ts:238


url

url(«destructured»?): string

Generates a URL to the message.

Parameters

NameTypeDescription
«destructured»Object-
› instance?stringThe instance of Discord to use. Defaults to "stable". (discord.com/channels/xxx/xxx/xxx) Default "stable"

Returns

string

Defined in

packages/disploy/src/structs/Message.ts:177