GitHub

ReceiveOptions

API reference for ReceiveOptions.

How updates run.

  • on_unhandled: updates that give no event, the excluded contexts among them.
  • deadline: how long ChatHandler.handle has before the update is notAccepted. Default 10 seconds.
  • click_deadline: how long a click handler has before the click is answered. Default 2.5 seconds. The handler then keeps running, detached, and the update is accepted.
  • command_deadline: how long a command handler has. Default 10 seconds. The handler is then interrupted, and the update is accepted.

Attributes

AttributeTypeDescription
on_unhandledOnUnhandled | None = None
deadlineDurationInput = '10 seconds'
click_deadlineDurationInput = '2500 millis'
command_deadlineDurationInput = '10 seconds'

Functions

__init__

__init__(*, on_unhandled=None, deadline='10 seconds', click_deadline='2500 millis', command_deadline='10 seconds') -> None
ParameterTypeDescription
on_unhandledOnUnhandled | None = None
deadlineDurationInput = '10 seconds'
click_deadlineDurationInput = '2500 millis'
command_deadlineDurationInput = '10 seconds'

parsed

parsed() -> _receive.Options

The options with their durations parsed.

Returns _receive.Options

def parsed(self) -> _receive.Options:
    """The options with their durations parsed."""
    return _receive.Options(
        on_unhandled=self.on_unhandled,
        deadline=from_input_unsafe(self.deadline),
        click_deadline=from_input_unsafe(self.click_deadline),
        command_deadline=from_input_unsafe(self.command_deadline),
    )