peyk.dispatcher.polling¶
Functions
|
Confirm and discard every update queued while the bot was offline. |
|
Performs the make poller operation for the dispatcher client. |
|
Clear supported webhooks before polling when requested. |
Classes
|
BalePoller provides the dispatcher API surface used by peyk. |
|
Fetch raw updates while owning the platform-specific offset. |
|
RubikaPoller provides the dispatcher API surface used by peyk. |
|
TelegramPoller provides the dispatcher API surface used by peyk. |
- class peyk.dispatcher.polling.BalePoller(bot: Bot[object], timeout: int, allowed_updates: Sequence[str] | None)[source]¶
Bases:
objectBalePoller provides the dispatcher API surface used by peyk.
- class peyk.dispatcher.polling.Poller(*args, **kwargs)[source]¶
Bases:
Protocol[RawT]Fetch raw updates while owning the platform-specific offset.
- class peyk.dispatcher.polling.RubikaPoller(bot: Bot[object], timeout: int, allowed_updates: Sequence[str] | None)[source]¶
Bases:
objectRubikaPoller provides the dispatcher API surface used by peyk.
- class peyk.dispatcher.polling.TelegramPoller(bot: Bot[object], timeout: int, allowed_updates: Sequence[str] | None)[source]¶
Bases:
objectTelegramPoller provides the dispatcher API surface used by peyk.
- async peyk.dispatcher.polling.drain_pending_updates(bot: Bot[object], *, page_size: int = 100, max_pages: int = 1000) int[source]¶
Confirm and discard every update queued while the bot was offline.
getUpdates(offset=N)confirms all updates withupdate_id < N, so we page through the queue and finish with one call atlast_id + 1. Returns how many updates were dropped.
- peyk.dispatcher.polling.make_poller(bot: Bot[object], timeout: int, allowed_updates: Sequence[str] | None) Poller[object][source]¶
Performs the make poller operation for the dispatcher client.
- Parameters:
bot – Value used by this operation.
timeout – Maximum time to wait for the operation.
allowed_updates – Value used by this operation.
- Returns:
Result produced by the dispatcher operation.
- async peyk.dispatcher.polling.prepare_polling(bot: Bot[object], *, skip_updates: bool) None[source]¶
Clear supported webhooks before polling when requested.
With
skip_updatesTelegram drops its pending queue through the webhook call; Bale has no such parameter, so the queue is drained withgetUpdatesafter the webhook is removed.Rubika’s endpoint-update parameters are intentionally not touched: the project decisions mark their semantics as low-confidence.