Skip to content

Commit c7914f6

Browse files
committed
Allow stackable plugin decorators for on_chat_member_updated
1 parent f0b1cc4 commit c7914f6

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

pyrogram/methods/decorators/on_chat_member_updated.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,14 @@ def decorator(func: Callable) -> Callable:
4646
if isinstance(self, pyrogram.Client):
4747
self.add_handler(pyrogram.handlers.ChatMemberUpdatedHandler(func, filters), group)
4848
elif isinstance(self, Filter) or self is None:
49-
func.handler = (
50-
pyrogram.handlers.ChatMemberUpdatedHandler(func, self),
51-
group if filters is None else filters
49+
if not hasattr(func, "handlers"):
50+
func.handlers = []
51+
52+
func.handlers.append(
53+
(
54+
pyrogram.handlers.ChatMemberUpdatedHandler(func, self),
55+
group if filters is None else filters
56+
)
5257
)
5358

5459
return func

0 commit comments

Comments
 (0)