From d2412b0fe845b9ebf3f0235ded0ba44825b53e54 Mon Sep 17 00:00:00 2001 From: Phyco-Ninja <60768764+Phyco-Ninja@users.noreply.github.com> Date: Mon, 17 Aug 2020 17:55:48 +0900 Subject: [PATCH] fix edit spam in Filters and Afk (#129) * Update filters.py * Update afk.py --- userge/plugins/utils/afk.py | 2 +- userge/plugins/utils/filters.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/userge/plugins/utils/afk.py b/userge/plugins/utils/afk.py index 266e05705..80f602a91 100644 --- a/userge/plugins/utils/afk.py +++ b/userge/plugins/utils/afk.py @@ -56,7 +56,7 @@ async def active_afk(message: Message) -> None: {'_id': 'AFK'}, {"$set": {'on': True, 'data': REASON, 'time': TIME}}, upsert=True)) -@userge.on_filters(IS_AFK_FILTER & ~Filters.me & ~Filters.bot & ( +@userge.on_filters(IS_AFK_FILTER & ~Filters.me & ~Filters.bot & ~Filters.edited & ( Filters.mentioned | (Filters.private & ~Filters.service & ( Filters.create(lambda _, __: Config.ALLOW_ALL_PMS) | Config.ALLOWED_CHATS))), allow_via_bot=False) diff --git a/userge/plugins/utils/filters.py b/userge/plugins/utils/filters.py index ed268e2ea..66e5addd1 100644 --- a/userge/plugins/utils/filters.py +++ b/userge/plugins/utils/filters.py @@ -154,7 +154,7 @@ async def add_filter(message: Message) -> None: await message.edit(text=out, del_in=3, log=__name__) -@userge.on_filters(~Filters.me & Filters.text & FILTERS_CHATS, group=1) +@userge.on_filters(~Filters.me & ~Filters.edited & Filters.text & FILTERS_CHATS, group=1) async def chat_filter(message: Message) -> None: """ filter handler """ if not message.from_user: