Skip to content

export Class

MessageCollector ​

extends ​

Collector<MessageCollectorOptions, number, Message>

Constructor ​

ts
 new MessageCollector( chat, options )
ParameterTypeDescription
chatChat
options?MessageCollectorOptions

Properties ​

get endReason : undefined | string ​

get next : Promise<Message> ​

chat : Chat ​

readonly client : Client ​

collection : Collection<number, any> ​

ended : boolean ​

filter : CollectorFilter ​

options : undefined | MessageCollectorOptions ​

received : number ​

Methods ​

asyncIterator ​

Returns: AsyncGenerator<unknown, void, unknown>

checkEnd( ) ​

Returns: boolean

collect( message ) ​

ParameterTypeDescription
messageMessage

Returns: null | number

dispose( message ) ​

ParameterTypeDescription
messageMessage

Returns: null | number

asynchandleCollect( collect ) ​

ParameterTypeDescription
collectMessage

Returns: Promise<void>

asynchandleDispose( dispose ) ​

ParameterTypeDescription
disposeMessage

Returns: Promise<void>

stop( reason ) ​

ParameterTypeDescription
reason = 'user'string

Returns: void

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