Skip to content

MessageManager

Defined in: packages/managers/src/message.ts:110

new MessageManager(rest, context, channelId, cache?, allowedMentions?): MessageManager

Defined in: packages/managers/src/message.ts:121

REST

ResourceContext

string

MessageCacheOptions

AllowedMentions

MessageManager

readonly cache: Collection<string, Message>

Defined in: packages/managers/src/message.ts:112

Cached messages; always empty unless a message cache is configured.

delete(messageId): boolean

Defined in: packages/managers/src/message.ts:213

string

boolean


fetch(messageId): Promise<Message>

Defined in: packages/managers/src/message.ts:160

Fetches a message. Concurrent fetches of one message share a request. If the message is stored or deleted (e.g. by a Gateway event) while the request is in flight, the result is returned but not cached, so it cannot overwrite fresher state or bring back a deleted message.

string

Promise<Message>


fetchMany(messageIds): Promise<Message[]>

Defined in: packages/managers/src/message.ts:197

Iterable<string>

Promise<Message[]>


resolve(messageId): Promise<Message>

Defined in: packages/managers/src/message.ts:139

string

Promise<Message>


send(options): Promise<Message>

Defined in: packages/managers/src/message.ts:142

MessageCreateOptions

Promise<Message>


set(messageId, message): this

Defined in: packages/managers/src/message.ts:192

Stores a message as the cached version (when caching is on), replacing any cached one.

string

Message

this

This manager.


upsert(data): Message

Defined in: packages/managers/src/message.ts:202

APIMessage

Message