telegramtelegram-botpython-telegram-bottelegram-webhooknode-telegram-bot-api

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.


Solution

  • 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.