MessageManager
Defined in: packages/managers/src/message.ts:110
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new MessageManager(
rest,context,channelId,cache?,allowedMentions?):MessageManager
Defined in: packages/managers/src/message.ts:121
Parameters
Section titled “Parameters”context
Section titled “context”channelId
Section titled “channelId”string
cache?
Section titled “cache?”allowedMentions?
Section titled “allowedMentions?”AllowedMentions
Returns
Section titled “Returns”MessageManager
Properties
Section titled “Properties”
readonlycache:Collection<string,Message>
Defined in: packages/managers/src/message.ts:112
Cached messages; always empty unless a message cache is configured.
Methods
Section titled “Methods”delete()
Section titled “delete()”delete(
messageId):boolean
Defined in: packages/managers/src/message.ts:213
Parameters
Section titled “Parameters”messageId
Section titled “messageId”string
Returns
Section titled “Returns”boolean
fetch()
Section titled “fetch()”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.
Parameters
Section titled “Parameters”messageId
Section titled “messageId”string
Returns
Section titled “Returns”Promise<Message>
fetchMany()
Section titled “fetchMany()”fetchMany(
messageIds):Promise<Message[]>
Defined in: packages/managers/src/message.ts:197
Parameters
Section titled “Parameters”messageIds
Section titled “messageIds”Iterable<string>
Returns
Section titled “Returns”Promise<Message[]>
resolve()
Section titled “resolve()”resolve(
messageId):Promise<Message>
Defined in: packages/managers/src/message.ts:139
Parameters
Section titled “Parameters”messageId
Section titled “messageId”string
Returns
Section titled “Returns”Promise<Message>
send()
Section titled “send()”send(
options):Promise<Message>
Defined in: packages/managers/src/message.ts:142
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”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.
Parameters
Section titled “Parameters”messageId
Section titled “messageId”string
message
Section titled “message”Returns
Section titled “Returns”this
This manager.
upsert()
Section titled “upsert()”upsert(
data):Message
Defined in: packages/managers/src/message.ts:202