1

I'm rellay happy with that community here. I found many answers in different cases. But this time I don't find one. So maybe someone can help me?

I'm working on a telegram bot using php and webhook updates. I track if my bot is added in a group chat by "new_chat_member" or "group_chat_created" and by "left_chat_member" if it got deleted from that groupe. UNtil then everything works fine.

If I - as admin - and the bot are the last two members and I delete the chat in the telegram app, I just get a "left_chat_member" for me (the last user in the groupe). But what about the bot? Isn't the chat deletet completely? Is the groupe remaining just with the bot as a member? Got someone an idea how to catch that situation? I would need something like "chat_deleted"

Thanks a lot, Markus

marommel
  • 11
  • 3

1 Answers1

0

I found a possible solution: https://core.telegram.org/bots/api#getchatmemberscount

Always on "left_chat_member" event, I check how many members are left. And if there is just two left I delete the chat of my "tracking" list. Still don't know if the bot is registered to that groub-chat on the telegram side, but don't really have another idea.

marommel
  • 11
  • 3