Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use getUpdates after setWebhook in Telegram Bot API

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

The problem is, that I have in console:

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

So the question is, how to UNSET webhook and use getUpdates?

like image 503
Lev Avatar asked Sep 12 '15 09:09

Lev


People also ask

Can Telegram BOT read group messages?

Another note is that the bot MUST be an admin on that group, regardless of the privacy settings. Otherwise, it will NOT be able to read any of the group messages. No, either the bot needs to be an admin OR privacy mode needs to be disabled.


2 Answers

In a browser send the following request:

https://api.telegram.org/bot655390656:bhFS50...ff3zO4/setwebhook
like image 198
B.I. Avatar answered Sep 24 '22 12:09

B.I.


as mentioned in Telegram bot api documentations you just need to pass empty string to url parameter.

> base_url = 'https://api.telegram.org/bot' + TOKEN + '/'
> data = {"url": ""}
> requests.post(base_url + 'setWebhook', data=data)
like image 27
Amir Avatar answered Sep 20 '22 12:09

Amir