Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Telegram bot detect a new member joining a channel event?

I have a Telegram bot and I set this bot as admin of a channel. Now, when a new user ordinarily joins a channel (not a group) there is no message on the channel and no message we could get with getUpdates method. Is it technically possible to post a message saying “A new user has joined the channel” - and this traps the “new member” event? Let me know.

like image 671
Carlos F Avatar asked Oct 20 '25 18:10

Carlos F


1 Answers

Unfortunately you can't check if user joined a channel or not via Telegram bot API for now. maybe in the future you can.

But you can do it for groups or super groups here :

https://core.telegram.org/bots/api#message find new_chat_members

These are also useful :

Telegram Bot Event When Users Join To Channel

How to get channel updates with Telegram robot

Update :

But a TG bot api with admin rights can see all its members. So even if the api doesn’t support it, it can track a count and see if it increases and then know that a new member joined. Correct? I don’t need to know exactly WHICH new member joined but just know a new one joined to share a welcome message

Yes you can use getChatMembersCount. Here is information from this link :

getChatMembersCount: Use this method to get the number of members in a chat. Returns Int on success.

and also can use getChatMember and here is some information :

getChatMember: Use this method to get information about a member of a chat. Returns a ChatMember object on success.

like image 105
GameO7er Avatar answered Oct 23 '25 07:10

GameO7er



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!