Updates
Module Updates
, available in the Evogram
instance as updates
object, allows to process updates from a Telegram bot. This module contains methods for registering update handlers and executing them when a new update is received.
The Updates
object has two properties - polling
and webhook
, which represent update transport methods.
The method on()
is used to register handlers for specific types of updates. This method has multiple overloads based on different update types and their corresponding contexts.
Finally, the onUpdate()
method executes the passed UpdateContext
object and calls registered handlers for that type of update. If no handler has been registered for this type of update, the onUpdate()
method ignores it.