Answer the question
In order to leave comments, you need to log in
Why webhook telegram is not installed via celery?
Hello, I'm trying to install a webhook for a telegram bot, for this I have a task in celery.
The task is very simple: it simply makes a post request to the address https://api.telegram.org/bottoken/setWebhook, where in the request body it contains the url where to send webhooks. It would seem that there is something complicated? The request passes, telegram replies that the webhook is installed, but does not send anything, when requesting the https://api.telegram.org/bottoken/getWebhookInfo method, telegram responds like this:
{
'ok': True,
'result': {
'url': 'https://<url>/75d78ee1-835f-461b-85bc-e5a755a829d4/webhook/telegram/',
'has_custom_certificate': False,
'pending_update_count': 0,
'last_error_date': 1518608932,
'last_error_message': 'SSL error {337047686, error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed}',
'max_connections': 40
}
}
data = {
'url': 'https://<url>/75d78ee1-835f-461b-85bc-e5a755a829d4/webhook/telegram/',
}
requests.post('https://api.telegram.org/bottoken/setWebhook', json=data)
{
'ok': True,
'result': {
'url': 'https://<url>/75d78ee1-835f-461b-85bc-e5a755a829d4/webhook/telegram/',
'has_custom_certificate': False,
'pending_update_count': 0,
'max_connections': 40
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question