class
Telecr::Webhook::Server
- Telecr::Webhook::Server
- Reference
- Object
Overview
Webhook server that listens for Telegram updates via HTTPS
Defined in:
webhook/webhook.crConstructors
Instance Method Summary
-
#bot : Telecr::Core::Bot
Core properties
-
#delete_webhook
Delete the current webhook
-
#get_webhook_info
Get current webhook information from Telegram
-
#handle_request(context : HTTP::Server::Context)
Handle incoming HTTP requests
-
#handle_webhook_request(context : HTTP::Server::Context)
Process incoming webhook from Telegram
-
#health_endpoint(context : HTTP::Server::Context)
Health check endpoint for monitoring services
- #host : String
- #logger : Log
- #port : Int32
-
#run
Start the webhook server
- #running : Bool
-
#running? : Bool
Check if server is currently running
- #secret_token : String
- #server : HTTP::Server | Nil
-
#set_webhook(**options)
Set the webhook URL with Telegram
- #ssl_context : OpenSSL::SSL::Context::Server | Nil
- #ssl_mode : Symbol
-
#stop
Register webhook URL with Telegram
-
#webhook_url : String
Generate the full webhook URL based on SSL mode
Constructor Detail
Instance Method Detail
Get current webhook information from Telegram
@return [JSON::Any] Webhook status information
Handle incoming HTTP requests
@param context [HTTP::Server::Context] The HTTP request context @return [nil]
Process incoming webhook from Telegram
@param context [HTTP::Server::Context] The HTTP request context @return [nil]
Health check endpoint for monitoring services
@param context [HTTP::Server::Context] The HTTP request context @return [nil]
Set the webhook URL with Telegram
@param options [Hash] Additional webhook options @option options [Int32] :max_connections (40) Maximum simultaneous connections @option options [Array(String)] :allowed_updates Update types to receive @option options [Int32] :drop_pending_updates Drop pending updates on set @return [String] The webhook URL that was set
Register webhook URL with Telegram
@return [nil] Stop the webhook server gracefully
@return [nil]
Generate the full webhook URL based on SSL mode
@return [String] The complete webhook URL including secret token