SetWebhook

@Serializable
data class SetWebhook : SetWebhookRequest, DataRequest<Boolean>

Represents a request for setting a webhook in Telegram's Bot API. A webhook allows Telegram to send updates directly to the bot via an HTTPS POST request to the provided URL, enabling real-time interaction.

Throws

if the provided maxAllowedConnections value is outside the permitted range (both allowedConnectionsLength and allowedConnectionsWithLocalServerLength)

Properties

Link copied to clipboard
@SerialName(value = "allowed_updates")
val allowedUpdates: List<String>?

A list of update types the bot will receive. Defaults to all update types.

Link copied to clipboard
@SerialName(value = "certificate")
val certificateFile: String? = null

An optional path to a public certificate file for webhook verification. Use only if a self-signed certificate is applied.

Link copied to clipboard
@SerialName(value = "drop_pending_updates")
val dropPendingUpdates: Boolean? = null

If true, all pending updates will be dropped when the webhook is changed.

Link copied to clipboard
@SerialName(value = "ip_address")
val ipAddress: String? = null

The fixed IP address for incoming webhook connections.

Link copied to clipboard
@SerialName(value = "max_connections")
val maxAllowedConnections: Int? = null

The maximum number of simultaneous HTTPS connections allowed to the webhook for delivering updates. You may use value outside of allowedConnectionsLength, but be sure that it is in allowedConnectionsWithLocalServerLength and you are using local bot api url

Link copied to clipboard
open override val requestSerializer: SerializationStrategy<*>
Link copied to clipboard
open override val resultDeserializer: DeserializationStrategy<Boolean>
Link copied to clipboard
@SerialName(value = "secret_token")
val secretToken: String? = null

An optional arbitrary secret key to ensure the webhook updates are coming from Telegram.

Link copied to clipboard
@SerialName(value = "url")
val url: String

The HTTPS URL to which updates will be posted. Must be valid and accessible.

Functions

Link copied to clipboard
open override fun method(): String