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> ​

get defaults : Function ​

get isJson : Function ​

get nest : Function ​

chat : BaseChat ​

readonly client : Client ​

readonly default? : any ​

readonly options : any ​

Methods ​

_add( data, cache, param2 ) ​

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

Add data with cache check to the current manager.

Returns: any

asynccopy( payload, ...message_ids ) ​

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

Copy messages of that belongs to this manager.

Returns: Promise<boolean>

asyncdelete( ...message_ids ) ​

ParameterTypeDescription
...message_idsnumber[]

Delete or bulk delete messages.

Returns: Promise<boolean>

asyncedit( payload ) ​

ParameterTypeDescription
payloadMessageEditPayloadThe payload data of the edit.

Edits a message that belongs to this manager.

Returns: Promise<boolean | Message>

asynceditCaption( payload ) ​

ParameterTypeDescription
payloadMessagecaptionEditPayloadthe payload data of the caption.

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

Returns: Promise<boolean | Message>

asynceditMedia( payload ) ​

ParameterTypeDescription
payloadMessageMediaEditPayloadThe payload data of the media.

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

Returns: Promise<boolean | Message>

asynceditReplyMarkup( payload ) ​

ParameterTypeDescription
payloadMessageReplyMarkupEditPayloadThe payload data of the reply markup.

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

Returns: Promise<boolean | Message>

asyncforward( payload, ...message_ids ) ​

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

Forward messages that belongs to this manager.

Returns: Promise<boolean | number[]>

asyncpin( message_id, disable_notification, business_connection_id ) ​

ParameterTypeDescription
message_idnumber
disable_notification?boolean
business_connection_id?string

Pins a message.

Returns: Promise<boolean>

asyncsetReaction( payload ) ​

ParameterTypeDescription
payloadMessageReactionPayloadThe payload data of the reaction.

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

Returns: Promise<boolean>

asyncunpin( message_id, business_connection_id ) ​

ParameterTypeDescription
message_idnumber
business_connection_idstring

Unpins a message.

Returns: Promise<boolean>

asyncunpinAll( ) ​

Unpin all pinned messages.

Returns: Promise<boolean>

A modern, powerful library for building your Telegram bots, with seamless support for both JavaScript and Typescript.