PollingOptions
Options that can be specified when running the bot via simple long polling.
Properties
limit
limit?: number;
Limits the number of updates to be retrieved per get
call. Values between 1-100 are accepted. Defaults to 100.
timeout
timeout?: number;
Timeout in seconds for long polling. grammY uses 30 seconds as a default value.
allowed_updates
allowed_updates?: ReadonlyArray<Exclude<keyof Update, "update_id">>;
A list of the update types you want your bot to receive. For example, specify [“message”, “edited_channel_post”, “callback_query”] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member (default). If not specified, the previous setting will be used.
Please note that this parameter doesn’t affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.
drop_pending_updates
drop_pending_updates?: boolean;
Pass True to drop all pending updates before starting the long polling.
onStart
onStart?: (botInfo: UserFromGetMe) => void | Promise<void>;
A callback function that is useful for logging (or setting up middleware if you did not do this before). It will be executed after the setup of the bot has completed, and immediately before the first updates are being fetched. The bot information bot
will be available when the function is run. For convenience, the callback function receives the value of bot
as an argument.