Evgeniy
Evgeniy

Reputation: 3349

How to remove service messages from Telegram with Bot API?

I have a supergroup in Telegram and a Bot, which is administrator of a group. When a new user join or left group, service message (with grey background) is appear in chat, for example

Username join to a chat
Username is join to a chat by invite link
Username is left the chat

Is it possible to catch and delete such service messages from chat with Bot API? Thanks in advance!

PS. I'am using https://github.com/php-telegram-bot/core

Upvotes: 0

Views: 7220

Answers (1)

Sean Wei
Sean Wei

Reputation: 7975

You need to add Request::sendMessage() to each update events

PS. There already have @AntiServiceMessageBot can do this.

Upvotes: 1

Related Questions