Class
MessageManager
Per-channel message cache + fetch. Access via `channel.messages`. `fetch` always writes through the client message cache (when enabled) and constructs Message from the cached payload so `get` stays coherent.
Constructor
new MessageManager
(client: Client, channelId: string)| Param | Type | Description |
|---|---|---|
| client | Client | |
| channelId | string |
Methods
fetch
(messageId: string): Promise<Message>Fetch a single message by ID.
| Param | Type | Description |
|---|---|---|
| messageId | string |
fetch
(options: FetchMessagesOptions): Promise<Collection<string, Message>>Fetch multiple messages with query options (limit, before, after, around).
| Param | Type | Description |
|---|---|---|
| options | FetchMessagesOptions |
fetch
(idOrOptions: string | FetchMessagesOptions): Promise<Message | Collection<string, Message>>| Param | Type | Description |
|---|---|---|
| idOrOptions | string | FetchMessagesOptions |
fetchMany
(options: FetchMessagesOptions): Promise<Collection<string, Message>>Fetch multiple messages from the API with pagination/filtering.
| Param | Type | Description |
|---|---|---|
| options | FetchMessagesOptions |
fetchOne
(messageId: string): Promise<Message>Fetch a single message from the API.
| Param | Type | Description |
|---|---|---|
| messageId | string |
get
(messageId: string): Message | undefinedRetrieve a cached message by ID, or `undefined` if missing / caching disabled.
| Param | Type | Description |
|---|---|---|
| messageId | string |
wrap
(data: APIMessage): MessageCache API data and return a Message built from the cached entry when present.
| Param | Type | Description |
|---|---|---|
| data | APIMessage |