Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is that possible a telegram bot can remove messages from group

Tags:

telegram-bot

i want create telegram bot . It can join to the group and delete messages in group . Is that possible a telegram bot can remove messages from group ? i search and some people say yes it possible , some people say no

like image 694
Pouria Parhami Avatar asked Dec 10 '22 13:12

Pouria Parhami


2 Answers

Check this link out, it seems the new bot API made it possible with some restrictions:
https://core.telegram.org/bots/api#deletemessage
The following details are from telegram API page:

  • A message can only be deleted if it was sent less than 48 hours ago.
  • Bots can delete outgoing messages in groups and supergroups.
  • Bots granted can_post_messages permissions can delete outgoing messages in channels.
  • If the bot is an administrator of a group, it can delete any message there.
  • If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there.

Returns True on success.

like image 100
Ph4r5h4d Avatar answered Dec 28 '22 12:12

Ph4r5h4d


This is now outdated, please see Darkc0d3r's answer


Using the Telegram Bot API? No, there is no such functionality as of now.

However you can if you are using the Telegram API, where you can use the messages.deleteMessages method, which requires you to give it a list of message id's as a parameter.

like image 39
Hoi_A Avatar answered Dec 28 '22 12:12

Hoi_A