usernein / pyromod

A monkeypatcher add-on for Pyrogram
https://pyromod.pauxis.dev/
GNU Lesser General Public License v3.0
238 stars 69 forks source link

admins filter and admins with permission decorator #8

Closed Bekacru closed 1 year ago

Bekacru commented 2 years ago

1. Filter for filtering admins in a group

example: @client.on_message(filters.group_admins)

2. Decorator for filtering channel or group admins with a specific permission

example: from pyromod.decorators import adminsWith

@client.on_message() @adminsWith("can_delete_messages", unAuthorisedReply = "You don't have the permission." ) async def deleteMessage(c, m):...

Bekacru commented 2 years ago

I largely use Pyromod's dialogue feature, but there are still many other features that might be added to the library to avoid having to implement the same functionality over. Since Pyromod has already been utilized by the community, rather than coming up with my own project, I believe I should open a PR for thing and make improvements that I would use and hopefully help others too. So this is my first pr and if you guys are cool with it, I'll also open the WIP on the things I'm working on.