2

I want to create new bot that print users first name in telegram groups.

So it could be easily done in public groups but in private groups I need its id so I have to add bot to private groups and then what should I do?

I want to do it in Python or Pyrogram also I am not interested to use telegram API like this:

https://api.telegram.org/bot<token>/getUpdates

because I can not use it when I am using Python-telegram bot library.

The main problem is how am I suppose to get private group ids after I add the bot to it?

Tibebes. M
  • 6,940
  • 5
  • 15
  • 36

1 Answers1

4

simply make the bot an admin in the targeted group, then the bot will be able to read messages from the group, thus you'll get the id

Or disable privacy mode from BotFather, check the link below: https://core.telegram.org/bots#privacy-mode

Yasser Sebai
  • 260
  • 2
  • 11
  • by receiving messages, any message your bot can read will be provided by a lot of information, including the id of the chat which is in this case the group's id... the easiest way to do so is by going to this link : [link] (https://api.telegram.org/bot"your token here"/getupdates) and send a dummy message to the targeted group and the id should be crystal clear... note that the data will be returned as json so it will be confusing to read it in as raw data – Yasser Sebai May 18 '20 at 09:57
  • the problem is i can use bot token one time so python-telegram-bot will use my bot token and i cant use it in (api.telegram.org/bot"your) ! – Maverick0o0 May 18 '20 at 16:30