How to use getUpdates after setWebhook in Telegram Bot API

I am using setWebhook for my telegram bot, and now I need to use getUpdates . I have read the docs and they say that I can only use one method.

The problem is that in my console:

{"ok":false,"error_code":409,"description":"Error: Conflict: another webhook is active"}

So the question is, how does UNSET use a web host and use getUpdates ?

+4
source share
3 answers

as stated in the Telegram bot api docs, you just need to pass an empty string to the parameter url.

> base_url = 'https://api.telegram.org/bot' + TOKEN + '/'
> data = {"url": ""}
> requests.post(base_url + 'setWebhook', data=data)
+9
source

In the browser, send the following request:

https://api.telegram.org/bot655390656:bhFS50...ff3zO4/setwebhook
+5

deleteWebhook()

https://core.telegram.org/bots/api#deletewebhook

,

import telepot
bot = telepot.Bot('YOUR_AUTHORIZATION_TOKEN')
bot.deleteWebhook()
0

Source: https://habr.com/ru/post/1607062/


All Articles