diff --git a/example-config.yaml b/example-config.yaml index a0b5971..0c9fa1b 100644 --- a/example-config.yaml +++ b/example-config.yaml @@ -20,3 +20,4 @@ config: log_reports: true log_forwards: true log_ring_maxlen: 69420 + auto_clear_reactions: false diff --git a/sukuinote/plugins/auto_clear_reactions.py b/sukuinote/plugins/auto_clear_reactions.py new file mode 100644 index 0000000..7856b7c --- /dev/null +++ b/sukuinote/plugins/auto_clear_reactions.py @@ -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)