You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
615 B

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