Add auto-clear reactions

This commit is contained in:
blank X 2022-03-09 15:06:52 +07:00
parent 3d96fe5f89
commit fa54d641cc
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
2 changed files with 16 additions and 0 deletions

View File

@ -20,3 +20,4 @@ config:
log_reports: true
log_forwards: true
log_ring_maxlen: 69420
auto_clear_reactions: false

View File

@ -0,0 +1,15 @@
import asyncio
from pyrogram import Client, filters
from pyrogram.raw.functions.messages import ReadReactions
from .. import config, log_errors
# I fucking HATE reactions!
@Client.on_message(filters.outgoing & filters.edited)
@log_errors
async def auto_clear_reactions(client, message):
if not config['config'].get('auto_clear_reactions') or not message.reactions:
return
while True:
if (await client.send(ReadReactions(peer=await client.resolve_peer(message.chat.id)))).pts_count > 0:
break
await asyncio.sleep(1)