telegramtelegram-bot

Telegram bot /getUpdates does not contain data


I have a bot that I have added to a group. I messages the group to get the group ID from the following:

https://api.telegram.org/bot1856444417:AAH4vG6lkAbFNkM41e4444k-3s42f0-abgs/getUpdates

but I just get the result:

{"ok":true,"result":[]}

I have tried removing the bot and re-addng it and I have tried @ the bot but neither gives me a result.

When I originally created the bot I was able to get an ID from a chat I had with it directly but now even that has stopped working.

This method of getting the chatID seems so flakey. Am I doing something wrong or is there any other way to get the chatid?


Solution

  • For anyone having this issue, it is because your bot have the Privacy Group mode enabled.

    On BotFather chat, list your created bots and select the respective bot where you to change the Group Privacy setting. Turn it off and there you go, now the result array from Telegram API will be properly displayed.