4

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.

Ebrahim Bashirpour
  • 717
  • 2
  • 10
  • 21
Carlos F
  • 893
  • 2
  • 12
  • 30

1 Answers1

5

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.

GameO7er
  • 2,028
  • 1
  • 18
  • 33
  • 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 – Carlos F Dec 07 '19 at 15:33
  • Get count have some problem. If an user leave a group an then another sig in, the number is the same and this logic fail. I don't know why telegram makes this management so difficult – vctlzac Dec 18 '22 at 14:10