Struct tbot::event_loop::webhook::Webhook
source · pub struct Webhook<'a> { /* private fields */ }Expand description
Configures webhook and starts a server.
To construct a Webhook, use EventLoop::webhook.
Implementations§
source§impl<'a> Webhook<'a>
impl<'a> Webhook<'a>
sourcepub fn accept_updates_on(self, url: String) -> Self
pub fn accept_updates_on(self, url: String) -> Self
Configures the URL that tbot will accept connections to.
/ by default.
Panics
Panics if the URL doesn’t starts with /.
sourcepub fn ip_address(self, ip_address: impl Into<IpAddr>) -> Self
pub fn ip_address(self, ip_address: impl Into<IpAddr>) -> Self
Configures the IP address which the Bot API server will use to send
updates avoiding DNS. Reflects the ip_address parameter.
sourcepub const fn certificate(self, certificate: &'a str) -> Self
pub const fn certificate(self, certificate: &'a str) -> Self
Configures certificate.
sourcepub const fn max_connections(self, max: NonZeroU32) -> Self
pub const fn max_connections(self, max: NonZeroU32) -> Self
Configures max_connections.
sourcepub const fn allowed_updates(self, updates: AllowedUpdates) -> Self
pub const fn allowed_updates(self, updates: AllowedUpdates) -> Self
Configures allowed_updates.
sourcepub const fn drop_pending_updates(self) -> Self
pub const fn drop_pending_updates(self) -> Self
Sets drop_pending_updates to true.
sourcepub const fn request_timeout(self, timeout: Duration) -> Self
pub const fn request_timeout(self, timeout: Duration) -> Self
Configures for how long tbot should wait for setWebhook. If you
don’t configure this value, it is set to 60s.