Skip to content

Commit

Permalink
fix edit spam in Filters and Afk (UsergeTeam#129)
Browse files Browse the repository at this point in the history
* Update filters.py

* Update afk.py
  • Loading branch information
Phyco-Ninja authored Aug 17, 2020
1 parent 9038951 commit d2412b0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion userge/plugins/utils/afk.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion userge/plugins/utils/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit d2412b0

Please sign in to comment.