Module telexide::client

source ·
Expand description

The Client manages your registered event handlers and provides them with up-to-date access to the api connection.

The act of dispatching events to configured handlers is also handled directly via the Client. In addition, the api and framework modules are also automatically handled by the Client for you.

A Context is provided for every handler, providing them with access to the api connection and any shared data you have set.

See here for some examples on how to use the Client.

Structs

  • The Client is the main object to manage your interaction with telegram.
  • A builder for the Client object to make customisation easier
  • The context object is an utility object that gets passed to all event handlers, it provides access to the API client and to any custom data you have set in the data object.
  • The stream of incoming updates, created by long polling the telegram API using their getUpdates endpoint.
  • Handles listening to the telegram webhook and will provide you with the incoming updates
  • Represents the options to set for the webhook handling

Type Aliases

  • A function that handles a new update, it receives a Context and Update and returns a pinned future. Wrap an async function with #[prepare_listener] for easier development.
  • A function that handles a new raw update, it receives a Context and RawUpdate and returns a pinned future. Wrap an async function with #[prepare_listener] for easier development.