Optional
catchWhether to catch up with missed updates when starting updates loop.
Note: In case the storage was not properly closed the last time, "catching up" might result in duplicate updates.
Optional
channelADVANCED
PTS limit for getChannelDifference
requests (max. 100000).
When there are more updates than this limit, the library will
skip some of them.
According to the official docs,
"Ordinary (non-bot) users are supposed to pass 10-100
", so passing >100
for users may lead to issues.
Optional
disableADVANCED
Whether to globally disable no-dispatch mechanism.
No-dispatch is a mechanism that allows you to call methods that return updates and correctly handle them, without actually dispatching them to the event handlers.
In other words, the following code will work differently:
dp.onNewMessage(console.log)
console.log(await tg.sendText('me', 'hello'))
disableNoDispatch
is true
, the sent message will be
dispatched to the event handler, thus it will be printed twicedisableNoDispatch
is false
, the sent message will not be
dispatched to the event handler, thus it will onlt be printed onceDisabling it may also improve performance, but it's not guaranteed.
Note: you can disable this on per-request basis by passing
shouldDispatch: true
to the method call that accepts it. For some methods you need to always passshouldDispatch: true
explicitly. This is noted in the corresponding method's documentation by "Doesn't followdisableNoDispatch
"
Optional
onADVANCED
Whenever an updates.channelDifferenceTooLong
is received,
the library isn't able to efficiently handle it on its own,
and will call this function for you to handle it instead.
Optional
overrideADVANCED
When openChat
method is used on a client, the library will
set up a timer to periodically fetch the new updates.
By default, it will respect the value provided by the server,
but it some cases you may want to override it (e.g. decrease it to
poll more often and potentially get updates faster).
The returned value is treated as seconds.
Parameters for the updates manager