def decorator(func: Callable) -> Callable: if isinstance(self, pyrogram.Client): self.add_handler(pyrogram.UserStatusHandler(func, filters), group) elif isinstance(self, Filter) or self is None: func.pyrogram_plugin = (pyrogram.UserStatusHandler(func, self), group if filters is None else filters) return func
def decorator(func): handler = pyrogram.UserStatusHandler(func, filters) if isinstance(self, Filter): return pyrogram.UserStatusHandler(func, self), group if filters is None else filters if self is not None: self.add_handler(handler, group) return handler, group
def decorator(func: callable) -> Tuple[Handler, int]: if isinstance(func, tuple): func = func[0].callback handler = pyrogram.UserStatusHandler(func, filters) if isinstance(self, Filter): return pyrogram.UserStatusHandler(func, self), group if filters is None else filters if self is not None: self.add_handler(handler, group) return handler, group