Sets the Telegram bot webhook.
(event, context)
| 65 | |
| 66 | |
| 67 | def 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 |
nothing calls this directly
no test coverage detected