mirror of
https://github.com/pyrogram/pyrogram
synced 2025-09-04 08:15:08 +00:00
Make add_handler return (handler, group) tuple
This commit is contained in:
@@ -263,7 +263,6 @@ class Client:
|
|||||||
|
|
||||||
return decorator
|
return decorator
|
||||||
|
|
||||||
# TODO: Maybe make add_handler return (handler, group)?
|
|
||||||
def add_handler(self, handler, group: int = 0):
|
def add_handler(self, handler, group: int = 0):
|
||||||
"""Use this method to register an update handler.
|
"""Use this method to register an update handler.
|
||||||
|
|
||||||
@@ -277,9 +276,14 @@ class Client:
|
|||||||
|
|
||||||
group (``int``, optional):
|
group (``int``, optional):
|
||||||
The group identifier, defaults to 0.
|
The group identifier, defaults to 0.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
A tuple of (handler, group)
|
||||||
"""
|
"""
|
||||||
self.dispatcher.add_handler(handler, group)
|
self.dispatcher.add_handler(handler, group)
|
||||||
|
|
||||||
|
return handler, group
|
||||||
|
|
||||||
def remove_handler(self, handler, group: int = 0):
|
def remove_handler(self, handler, group: int = 0):
|
||||||
"""Removes a previously-added update handler.
|
"""Removes a previously-added update handler.
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user