Add delete-same-channel-replies.py

This commit is contained in:
blank X 2020-11-13 19:46:49 +07:00
parent 0cc2b95aa9
commit c7a6dde8df
1 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,18 @@
from pyrogram import Client, filters
from ... import log_errors, public_log_errors
@Client.on_message(~filters.sticker & filters.chat(-1001150433131) & ~filters.linked_channel)
@log_errors
@public_log_errors
async def delete_same_channel_replies(client, message):
text = message.text or message.caption
if not text:
return
reply = message.reply_to_message
if getattr(reply, 'empty', True):
return
if not await filters.linked_channel_filter(None, None, reply):
return
reply_text = reply.text or reply.caption
if text == reply_text:
await message.delete()