Skip to content

MessageManager

Package: @erinjs/core

Manages messages for a channel. Access via channel.messages.

Constructor

NameTypeOptionalDescription
clientClientNo
channelIdstringNo

Properties

None

Methods

fetch() async

Fetch a message by ID from this channel. When message caching is enabled, the fetched message is added to the cache.

Returns: Promise<Message>

Parameters:

NameTypeOptionalDescription
messageIdstringNoSnowflake of the message

get()

Get a message from cache. Returns undefined if not cached or caching is disabled. Requires options.cache.messages > 0.

Returns: Message | undefined

Parameters:

NameTypeOptionalDescription
messageIdstringNoSnowflake of the message

Released under the Apache-2.0 License.