-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove service message #58
Comments
A bot can remove messages https://stackoverflow.com/a/45285278/5457433 from groups and receive leave/join notifications ... not sure about service messages. It shouldn't be hard to set it up e.g. a bot that deletes all messages. I'll give it a shot. |
php-telegram-bot/core#730 I am reffering to this , I am not sure about PHP though |
Join/left messages are bundled in fields containing the users in import info.mukel.telegrambot4s.api._
import info.mukel.telegrambot4s.methods._
import info.mukel.telegrambot4s.models._
/**
* Remove join/left messages from groups.
*/
object GroupBot extends TelegramBot
with Polling {
lazy val token = "TOKEN"
override def receiveMessage(msg: Message): Unit = {
super.receiveMessage(msg)
if (msg.newChatMembers.isDefined || msg.leftChatMember.isDefined)
request(DeleteMessage(msg.source, msg.messageId))
}
}
GroupBot.run() |
Thanks It worked , but only for single group ,when I added the bot in two group it tarted throwing me this error .
|
It seems like a permission issue. The bot must be admin or have permission to delete messages. |
Any updates on this? |
works perfect after giving permission. |
hi . my bot delete the join and left service messages in my group but speed of deleting is so slow . when i add 50 person in one action with telegraph 50 service message apear in room and about 30 seconds for delete this 50 service messages with bot . my bot writen in php . see my code please . can you help me for solve this problem ? thanks |
@$newmember = $result->message->new_chat_member->id; |
Can I remove the service message using the this
for eg
I want to remove the telegram message whenever user join or leave the group
The text was updated successfully, but these errors were encountered: