A Telegram Bot implemented fetch all users automatically in the group and replace the keywords like
@all
to tag all users like@sheiun @tom ...
.
Since there is no telegram api for fetching all users there is only
chat.get_administrators
and it cannot achieve our aim, tagging all users, so we propose a method to usetelethon
to login as a user and get all users' id viaGetParticipantsRequest
and retreive correspond user viachat.get_member(user_id)
.
Or you can use our bot Metion All Members Bot
- Register a bot via Bot Father
- Add the bot into your group and give it 'Invite users via link' and 'Delete messages' permissions
- Register api key from https://my.telegram.org/auth
- Edit your
config.json
like config.example.json to fill bot token, api id and api hash - Run
python dump_users.py
to dump users in a group via invite link - Run
python bot.py