MCPcopy Create free account
hub / github.com/serverless/examples / set_webhook

Function set_webhook

aws-python-telegram-bot/handler.py:67–83  ·  view source on GitHub ↗

Sets the Telegram bot webhook.

(event, context)

Source from the content-addressed store, hash-verified

65
66
67def set_webhook(event, context):
68 """
69 Sets the Telegram bot webhook.
70 """
71
72 logger.info('Event: {}'.format(event))
73 bot = configure_telegram()
74 url = 'https://{}/{}/'.format(
75 event.get('headers').get('Host'),
76 event.get('requestContext').get('stage'),
77 )
78 webhook = bot.set_webhook(url)
79
80 if webhook:
81 return OK_RESPONSE
82
83 return ERROR_RESPONSE

Callers

nothing calls this directly

Calls 1

configure_telegramFunction · 0.85

Tested by

no test coverage detected