Skip to content

export Class

MessagesManager ​

extends ​

CachedManager<number, Message>

Constructor ​

ts
new MessagesManager( chat )
ParameterTypeDescription
chatBaseChat

Properties ​

get cache : Collection<CachedManager.K, CachedManager.V> ​

chat : BaseChat ​

readonly client : Client ​

readonly default? : any ​

readonly options : any ​

Methods ​

_add( data, cache, param2 ) ​

Add data with cache check to the current manager.

ParameterTypeDescription
dataanyThe data to add to the cache manager.
cache = truebooleanPass True to cache the data.
param2 = {}anyAdditional data to pass.

Returns: any

asynccopy( payload, ...message_ids ) ​

Copy messages of that belongs to this manager.

ParameterTypeDescription
payloadCopyMessagePayloadThe payload data of the copy.
...message_idsnumber[]The ids of the messages to forward.

Returns: Promise<boolean>

asyncdelete( ...message_ids ) ​

Delete or bulk delete messages.

ParameterTypeDescription
...message_idsnumber[]

Returns: Promise<boolean>

asyncedit( payload ) ​

Edits a message that belongs to this manager.

ParameterTypeDescription
payloadMessageEditPayloadThe payload data of the edit.

Returns: Promise<boolean | Message>

asynceditCaption( payload ) ​

Edits the caoption of a message that belongs to this manager.

ParameterTypeDescription
payloadMessagecaptionEditPayloadthe payload data of the caption.

Returns: Promise<boolean | Message>

asynceditMedia( payload ) ​

Edits the media of a message that belongs to this manager.

ParameterTypeDescription
payloadMessageMediaEditPayloadThe payload data of the media.

Returns: Promise<boolean | Message>

asynceditReplyMarkup( payload ) ​

Edits the reply markup of a message that belongs to this manager.

ParameterTypeDescription
payloadMessageReplyMarkupEditPayloadThe payload data of the reply markup.

Returns: Promise<boolean | Message>

asyncforward( payload, ...message_ids ) ​

Forward messages that belongs to this manager.

ParameterTypeDescription
payloadForwardPayloadThe payload data of the forward.
...message_idsstring | number[]The ids of the messages to forward.

Returns: Promise<boolean | number[]>

asyncpin( message_id, disable_notification, business_connection_id ) ​

Pins a message.

ParameterTypeDescription
message_idnumber
disable_notification?boolean
business_connection_id?string

Returns: Promise<boolean>

asyncsetReaction( payload ) ​

Sets the reaction of a message that belongs to this manager.

ParameterTypeDescription
payloadMessageReactionPayloadThe payload data of the reaction.

Returns: Promise<boolean>

asyncunpin( message_id, business_connection_id ) ​

Unpins a message.

ParameterTypeDescription
message_idnumber
business_connection_idstring

Returns: Promise<boolean>

asyncunpinAll( ) ​

Unpin all pinned messages.

Returns: Promise<boolean>