From 34fda4f251ddf3a205aa1c137e5897138452c7cf Mon Sep 17 00:00:00 2001 From: Jonathan <5377074j@gmail.com> Date: Sun, 26 Sep 2021 13:31:26 +0300 Subject: [PATCH] Add: delete service messages --- bot/filters.py | 1 + bot/handlers/deleteServiceMessages.py | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 bot/handlers/deleteServiceMessages.py diff --git a/bot/filters.py b/bot/filters.py index 4342b15..73ccce6 100644 --- a/bot/filters.py +++ b/bot/filters.py @@ -12,3 +12,4 @@ show_admins_list = private & filters.command('admins') refresh_admins_list = filters.regex('^refadm') select_group__show_admins = filters.regex("^adm=") +service = filters.group & filters.service diff --git a/bot/handlers/deleteServiceMessages.py b/bot/handlers/deleteServiceMessages.py new file mode 100644 index 0000000..fea1f80 --- /dev/null +++ b/bot/handlers/deleteServiceMessages.py @@ -0,0 +1,7 @@ +from pyrogram import Client +from ..filters import service + + +@Client.on_message(service) +async def delete_service_messages(_, message): + await message.delete()