I'm trying to obtain all users of a telegram group, I see the method getChatAdministrators, but I think the API doesn't have a method for obtaining all members.
I'm using telegram-bot-api of nodejs
I'm trying to obtain all users of a telegram group, I see the method getChatAdministrators, but I think the API doesn't have a method for obtaining all members.
I'm using telegram-bot-api of nodejs
What you are trying to achieve is currently not possible using the bot api. I'm not sure about the nodejs api, but the official bot api (which your implementation is likely to use) currently doesn't allow getting specific information about all members.
What you can do though, is query how many users are currently in a group, using getchatmemberscount. And if you have the user id of one of the groups members, you can get further information about that user with the getchatmember function.
With the Telegram API, you can control a "regular" user about how you would control a bot. It won't be apparent to any other users that your account is automated if you decide to use this API; in fact, the official telegram apps use it as their backend. However, you will need to sign up with your phone number just like you would with a regular account.
With this API, you can query all the chats the bot is in very easily using the getChats function. Then, you can query full chat info for a specific chat (including all users and their details) using getFullChat.
You can extract all the members of any given group or channel(you need to be an admin for channel) using telethon, you can use telethon for that, you can find it here :- https://github.com/LonamiWebs/Telethon
Telethon extracts all the members of an given group and saves it in a SQLite database.
Telegram Bot API does not provide such functionality, the only way to do this efficiently is by using userbot (bot running under regular Telegram account).
I use the GetChatMemberCount method of the telegram bot API to get the membercount of the group. And I can also use the bot API to get the user information who sent message to the group. I doubt that is there any other way to get the membercount without the bot API.
© 2022 - 2024 — McMap. All rights reserved.