I’ve seen some bot creators before with options to extract all members of bot who interacted (or started) bot before. but I can’t find any method in telegram docs for extract users. Do you know any method for extract users of bot in any library or something?
I asked ChatGPT but he gives me a code for extract chat users:
async def get_users(client, message):
if message.text == "/users":
# get all users who have ever interacted with the bot
async for member in app.iter_chat_members(chat_id=message.chat.id):
user = member.user
if user.is_bot:
continue
if user.status == 'restricted' or user.status == 'kicked':
continue
How can I get UserID from user who started my bot before if I didn’t save it?
there is any method for extract users of bot in any library or something?
2
Answers
You cant!
After you’ve passed an
offset
to thegetUpdates
call to remove any messages from the update queue, they’re gone. ReffThere is no way to ask Telegram for a list of chat’s that ever talked with your bot.
The only way of doing this is by a custom implementation where you save each chat id somewhere to recall later.
i am founder "Uranus Creator" and the method you are talking about.
i was the first person who found this method.
don’t try, you cant find it anywhere.
each person who found this method himself created a robot creator with it and will not publish it anywhere.