diff --git a/delete-same-channel-replies.py b/delete-same-channel-replies.py new file mode 100644 index 0000000..d91bd92 --- /dev/null +++ b/delete-same-channel-replies.py @@ -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()