Function teloxide::update_listeners::webhooks::axum
source · pub async fn axum<R>(
bot: R,
options: Options
) -> Result<impl UpdateListener<Err = Infallible>, R::Err>where
R: Requester + Send + 'static,
<R as Requester>::DeleteWebhook: Send,
Available on crate features
webhooks-axum
and webhooks
only.Expand description
Webhook implementation based on the axum framework.
This function does all the work necessary for webhook to work, it:
- Calls
set_webhook
, so telegram starts sending updates our way - Spawns axum server listening for updates
- When the update listener is
stop
ped, callsdelete_webhook
Panics
If binding to the address fails.
Fails
If set_webhook()
fails.
See also
axum_to_router
and axum_no_setup
for lower-level versions of this
function.