Allow stackable plugin decorators for on_chat_member_updated

This commit is contained in:
Dan 2021-03-17 20:10:09 +01:00
parent f0b1cc41f3
commit c7914f6c57

View File

@ -46,9 +46,14 @@ class OnChatMemberUpdated(Scaffold):
if isinstance(self, pyrogram.Client):
self.add_handler(pyrogram.handlers.ChatMemberUpdatedHandler(func, filters), group)
elif isinstance(self, Filter) or self is None:
func.handler = (
pyrogram.handlers.ChatMemberUpdatedHandler(func, self),
group if filters is None else filters
if not hasattr(func, "handlers"):
func.handlers = []
func.handlers.append(
(
pyrogram.handlers.ChatMemberUpdatedHandler(func, self),
group if filters is None else filters
)
)
return func