skip to Main Content

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


  1. How can I get UserID from user who started my bot before if I didn’t save it?

    You cant!

    After you’ve passed an offset to the getUpdates call to remove any messages from the update queue, they’re gone. Reff

    There 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.

    Login or Signup to reply.
  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search