hoshii / Exports / ChatMessage

ChatMessage<T>

Represents a chat message

Type parameters

NameType
Textends AnyTextableChannel = AnyTextableChannel

Hierarchy

  • Base<string>

    ChatMessage

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new ChatMessage<T>(data, client)

Create a new ChatMessage

Type parameters

NameType
Textends TextChannel<T> = TextChannel

Parameters

NameTypeDescription
dataRawChatMessageThe raw data of the message
clientClientThe client

Overrides

Base.constructor

Defined in

lib/structures/ChatMessage.ts:161open in new window

Properties

_cachedChannel

Private _cachedChannel: T extends TextChannel ? T : undefined

The cached channel the message is in

Defined in

lib/structures/ChatMessage.ts:79open in new window


_cachedServer

Private Optional _cachedServer: T extends Server ? Server : Server

The cached server that created the message

Defined in

lib/structures/ChatMessage.ts:84open in new window


channelID

channelID: string

The ID of the channel the message is in

Defined in

lib/structures/ChatMessage.ts:89open in new window


client

client: Client

The bot client

Inherited from

Base.client

Defined in

lib/structures/Base.ts:13open in new window


content

Optional content: string

The content of the message

Defined in

lib/structures/ChatMessage.ts:94open in new window


createdAt

createdAt: Date

The date the message was created at

Defined in

lib/structures/ChatMessage.ts:99open in new window


createdBy

createdBy: string

The ID of the user who created the message

Defined in

lib/structures/ChatMessage.ts:104open in new window


createdByWebhookID

Optional createdByWebhookID: string

The ID of the webhook that created the message

Defined in

lib/structures/ChatMessage.ts:109open in new window


deletedAt

deletedAt: Date

The date the message was deleted

Defined in

lib/structures/ChatMessage.ts:114open in new window


embeds

Optional embeds: [] | ChatEmbedOptions[]

An array of embeds in the message

Defined in

lib/structures/ChatMessage.ts:119open in new window


id

id: string

The ID of the item

Inherited from

Base.id

Defined in

lib/structures/Base.ts:16open in new window


isPrivate

isPrivate: boolean

Whether the message is private

Defined in

lib/structures/ChatMessage.ts:124open in new window


isSilent

isSilent: boolean

Whether the message is a silent reply

Defined in

lib/structures/ChatMessage.ts:129open in new window


mentions

mentions: Mentions

An object of mentions in the message

Defined in

lib/structures/ChatMessage.ts:134open in new window


replyMessageIDs

replyMessageIDs: string[]

An array of message IDs that this message is replying to

Defined in

lib/structures/ChatMessage.ts:139open in new window


serverID

serverID: string

The ID of the server the message is in

Defined in

lib/structures/ChatMessage.ts:144open in new window


type

type: MessageCategories

The type of message

Defined in

lib/structures/ChatMessage.ts:149open in new window


updatedAt

updatedAt: Date

The date the message was updated at

Defined in

lib/structures/ChatMessage.ts:154open in new window

Accessors

channel

get channel(): T extends TextChannel ? T : undefined

The channel the message is in

Returns

T extends TextChannel ? T : undefined

Defined in

lib/structures/ChatMessage.ts:185open in new window


member

get member(): T extends Server ? ServerMember : ServerMember | Promise<ServerMember>

The kmember that created the message

Returns

T extends Server ? ServerMember : ServerMember | Promise<ServerMember>

Defined in

lib/structures/ChatMessage.ts:229open in new window


server

get server(): T extends Server ? Server : Server

The server the message is in

Returns

T extends Server ? Server : Server

Defined in

lib/structures/ChatMessage.ts:207open in new window

Methods

addReactionEmote

addReactionEmote(emoteID): Promise<void>

Add a reaction emote to the message

Parameters

NameTypeDescription
emoteIDnumberThe ID of the emote

Returns

Promise<void>

Defined in

lib/structures/ChatMessage.ts:278open in new window


delete

delete(): Promise<void>

Delete the message

Returns

Promise<void>

Defined in

lib/structures/ChatMessage.ts:286open in new window


deleteReactionEmote

deleteReactionEmote(emoteID): Promise<void>

Delete a reaction emote from the message

Parameters

NameTypeDescription
emoteIDnumberThe ID of the emote

Returns

Promise<void>

Defined in

lib/structures/ChatMessage.ts:295open in new window


edit

edit<T>(options): Promise<ChatMessage<T>>

Edit the message

Type parameters

NameType
Textends TextChannel<T> = TextChannel

Parameters

NameTypeDescription
optionsMessageEditOptionsThe options to edit the message with

Returns

Promise<ChatMessage<T>>

Defined in

lib/structures/ChatMessage.ts:308open in new window


setCache

Private setCache(obj): Promise<void>

Parameters

NameType
objPromise<ServerMember> | Promise<Server>

Returns

Promise<void>

Defined in

lib/structures/ChatMessage.ts:314open in new window


toJSON

toJSON(): ChatMessageData

Returns the JSON representation of the item

Returns

ChatMessageData

Overrides

Base.toJSON

Defined in

lib/structures/ChatMessage.ts:331open in new window


update

Protected update(data): void

Parameters

NameType
dataRawChatMessage

Returns

void

Overrides

Base.update

Defined in

lib/structures/ChatMessage.ts:351open in new window

Last Updated:
Contributors: Reinhardt