MCPcopy Create free account
hub / github.com/eternnoir/pyTelegramBotAPI / run_webhooks

Method run_webhooks

telebot/__init__.py:478–581  ·  view source on GitHub ↗

This class sets webhooks and listens to a given url and port. Requires fastapi, uvicorn, and latest version of starlette. :param listen: IP address to listen to, defaults to "127.0.0.1" :type listen: :obj:`str`, optional :param port: A port which will be u

(self,
                    listen: Optional[str]="127.0.0.1",
                    port: Optional[int]=443,
                    url_path: Optional[str]=None,
                    certificate: Optional[str]=None,
                    certificate_key: Optional[str]=None,
                    webhook_url: Optional[str]=None,
                    max_connections: Optional[int]=None,
                    allowed_updates: Optional[List]=None,
                    ip_address: Optional[str]=None,
                    drop_pending_updates: Optional[bool] = None,
                    timeout: Optional[int]=None,
                    secret_token: Optional[str]=None,
                    secret_token_length: Optional[int]=20)

Source from the content-addressed store, hash-verified

476
477
478 def run_webhooks(self,
479 listen: Optional[str]="127.0.0.1",
480 port: Optional[int]=443,
481 url_path: Optional[str]=None,
482 certificate: Optional[str]=None,
483 certificate_key: Optional[str]=None,
484 webhook_url: Optional[str]=None,
485 max_connections: Optional[int]=None,
486 allowed_updates: Optional[List]=None,
487 ip_address: Optional[str]=None,
488 drop_pending_updates: Optional[bool] = None,
489 timeout: Optional[int]=None,
490 secret_token: Optional[str]=None,
491 secret_token_length: Optional[int]=20):
492 """
493 This class sets webhooks and listens to a given url and port.
494
495 Requires fastapi, uvicorn, and latest version of starlette.
496
497 :param listen: IP address to listen to, defaults to "127.0.0.1"
498 :type listen: :obj:`str`, optional
499
500 :param port: A port which will be used to listen to webhooks., defaults to 443
501 :type port: :obj:`int`, optional
502
503 :param url_path: Path to the webhook. Defaults to /token, defaults to None
504 :type url_path: :obj:`str`, optional
505
506 :param certificate: Path to the certificate file, defaults to None
507 :type certificate: :obj:`str`, optional
508
509 :param certificate_key: Path to the certificate key file, defaults to None
510 :type certificate_key: :obj:`str`, optional
511
512 :param webhook_url: Webhook URL to be set, defaults to None
513 :type webhook_url: :obj:`str`, optional
514
515 :param max_connections: Maximum allowed number of simultaneous HTTPS connections
516 to the webhook for update delivery, 1-100. Defaults to 40. Use lower values to limit the load on your bot's server,
517 and higher values to increase your bot's throughput., defaults to None
518 :type max_connections: :obj:`int`, optional
519
520 :param allowed_updates: A JSON-serialized list of the update types you want your bot to receive. For example, specify [“message”, “edited_channel_post”, “callback_query”]
521 to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all updates regardless of type (default).
522 If not specified, the previous setting will be used. defaults to None
523 :type allowed_updates: :obj:`list`, optional
524
525 :param ip_address: The fixed IP address which will be used to send webhook requests instead of the IP address resolved through DNS, defaults to None
526 :type ip_address: :obj:`str`, optional
527
528 :param drop_pending_updates: Pass True to drop all pending updates, defaults to None
529 :type drop_pending_updates: :obj:`bool`, optional
530
531 :param timeout: Request connection timeout, defaults to None
532 :type timeout: :obj:`int`, optional
533
534 :param secret_token: Secret token to be used to verify the webhook request, defaults to None
535 :type secret_token: :obj:`str`, optional

Callers 2

run_webhooks.pyFile · 0.45
run_webhooks.pyFile · 0.45

Calls 4

set_webhookMethod · 0.95
SyncWebhookListenerClass · 0.90
closeMethod · 0.45
run_appMethod · 0.45

Tested by

no test coverage detected