telegramtelegram-bot

how to see if a member has left from a telegram channel?


I want to develope a bot in telegram to set as the admin of my channel. And I want it to notify me whenever a member leaves the channel. And I want it to tell me who it was. and I prefer to have name or username.


Solution

  • New and the best way to do so is - https://core.telegram.org/bots/api#chatmemberupdated

    Telegram gives you an update on chat member update, so you can handle when user leaves your channel/chat or joins.

    Python examples is https://docs.python-telegram-bot.org/en/v21.9/examples.chatmemberbot.html and https://docs.python-telegram-bot.org/en/v21.9/telegram.chatmemberupdated.html#telegram.ChatMemberUpdated