Telegram API doesn't provide API for watching for changes in the list of members of a private channel. This project solves that by sampling the list of members periodically.
Each new member that joins/lefts the channel will send a notification via Telegram bot.
- Register a Telegram app, and write the
API_ID
andAPI_HASH
incredentials.py
. - Create a Telegram bot, and write the
BOT_TOKEN
incredentials.py
. - Set your phone number (
CLIENT_PHONE
) incredentials.py
. - Set the invite code for the channel (
CHANNEL_INVITE_CODE
) incredentials.py
. The invite code is the code-part of the invite link (https://t.me/joinchat/<invite-code>
). - Run:
python -m memberstracker
.