Add delete-same-channel-replies.py
This commit is contained in:
parent
0cc2b95aa9
commit
c7a6dde8df
|
@ -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()
|
Loading…
Reference in New Issue