The message listener works perfectly when someone joins the group where my bot has admin rights. However, when a user leaves the same group, the event doesn’t fire at all. I expected it to work for both joining and leaving events. Am I using the wrong event type to catch group departures? What’s the proper way to get notifications when group members leave?
yeah, message events don’t catch departures. you need a chat_member listener instead. also check your bot’s privacy settings in BotFather - privacy mode blocks group events like member changes. I had this same issue and turning off privacy mode fixed it completely.
You’re mixing up event types. Leave events won’t show up in the message listener.
You need to handle the chat_member event specifically. But managing all these event listeners and status checks manually gets messy fast. I’ve been there with bot projects - the event handling becomes a nightmare when you scale.
I had way better luck using Latenode for the bot logic. You can set up Telegram webhooks that automatically parse member changes and route them to different workflows based on action type. No manual event listeners or status checking needed.
The visual workflow builder makes it crystal clear what happens when someone joins vs leaves. You can chain other actions like database logging or notifications without writing more Node.js code.
Saved me tons of debugging time vs handling Telegram API events manually. Check it out: https://latenode.com
You’re listening for the wrong event. User exits don’t trigger message events - they create chat_member updates instead. Your allowed_updates looks fine, but you need a separate listener for chat member changes. The chat_member event handles both joins and leaves, so check the status field to tell them apart. When someone leaves, new_chat_member.status will show ‘left’ or ‘kicked’. This trips up a lot of people new to Telegram bots since the docs aren’t super clear about which events map to what.
Your config looks right, but you’re listening for message events when member departures actually trigger chat_member updates. I hit this same issue last year building a group bot. Here’s what I found: Telegram handles departures differently than joins for permissions - your bot needs specific rights to get leave notifications. Even as admin, make sure your bot has ‘restrict members’ permission turned on in group settings. Without it, Telegram won’t send chat_member updates for departures, even though your allowed_updates includes it. After I fixed the permissions, my chat_member listener caught both joins and leaves perfectly.
You’re catching departure events in the wrong place - they come through chat_member updates, not the message listener. But there’s more to it. Join and leave events have different timing. Joins fire immediately when someone enters, but departures get delayed or batched based on group size and how Telegram processes them internally. I’ve seen this a lot in bigger groups where leave events show up several seconds after someone actually left. Your polling setup has the right update types, but switch to webhooks if you need real-time departure notifications. Polling delays make it look like events aren’t firing when they’re just sitting in the queue. Also double-check your bot token has the right permissions for chat member events.
you’re listening to the wrong event. member leaves trigger chat_member, not message. try telegramBot.on('chat_member', (update) => { console.log('member change:', update) }) and check if update.new_chat_member.status is ‘left’ or ‘kicked’. works every time for me.