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