Abstract

MessageManager

export abstract class MessageManager<InGuild extends boolean = boolean> extends CachedManager<
Snowflake,
Message<InGuild>,
MessageResolvable
>
export abstract class MessageManager<InGuild extends boolean = boolean> extends CachedManager<
Snowflake,
Message<InGuild>,
MessageResolvable
>
Manages API methods for Messages and holds their cache.
NameConstraintsOptionalDefaultDescription
InGuildbooleanYesbooleanNone
constructor(channel, iterable?)
Constructs a new instance of the MessageManager class
NameTypeOptionalDescription
channelTextBasedChannelNoNone
iterableIterable<RawMessageData>YesNone
Readonly
cache:Collection<K, Holds>
The cache of items for this manager.
Inherited from DataManager
The channel that the messages belong to
Readonly
client:Client
The client that instantiated this Manager
Inherited from BaseManager
Readonly
holds:Constructable<Holds>
The data structure belonging to this manager.
Inherited from DataManager
delete(message):Promise<void>
Deletes a message, even if it's not cached.
NameTypeOptionalDescription
messageMessageResolvableNoThe message to delete
edit(message, options):Promise<Message<InGuild>>
Edits a message, even if it's not cached.
NameTypeOptionalDescription
messageMessageResolvableNoThe message to edit
optionsstring | MessagePayload | MessageEditOptionsNoThe options to edit the message
fetch(options):Promise<Message<InGuild>>
Fetches message(s) from a channel. The returned Collection does not contain reaction users of the messages if they were not cached. Those need to be fetched separately in such a case.
NameTypeOptionalDescription
optionsMessageResolvable | FetchMessageOptionsNoOptions for fetching message(s)
fetchPinned(cache?):Promise<Collection<Snowflake, Message<InGuild>>>
Fetches the pinned messages of this channel and returns a collection of them. The returned Collection does not contain any reaction data of the messages. Those need to be fetched separately.
NameTypeOptionalDescription
cachebooleanYesWhether to cache the message(s)
pin(message, reason?):Promise<void>
Pins a message to the channel's pinned messages, even if it's not cached.
NameTypeOptionalDescription
messageMessageResolvableNoThe message to pin
reasonstringYesReason for pinning
react(message, emoji):Promise<void>
Adds a reaction to a message, even if it's not cached.
NameTypeOptionalDescription
messageMessageResolvableNoThe message to react to
emojiEmojiIdentifierResolvableNoThe emoji to react with
resolve(idOrInstance):Holds
Resolves a data entry to a data Object.
Returns
An instance from this Manager
NameTypeOptionalDescription
idOrInstanceHoldsNoThe id or instance of something in this Manager
resolveId(idOrInstance):K
Resolves a data entry to an instance id.
Returns
NameTypeOptionalDescription
idOrInstanceK | HoldsNoThe id or instance of something in this Manager
unpin(message, reason?):Promise<void>
Unpins a message from the channel's pinned messages, even if it's not cached.
NameTypeOptionalDescription
messageMessageResolvableNoThe message to unpin
reasonstringYesReason for unpinning
valueOf():Collection<K, Holds>