2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-29 05:18:10 +00:00

Make add_handler return (handler, group) tuple

This commit is contained in:
Dan 2018-04-30 13:31:11 +02:00
parent deed74840a
commit 53b0736975

View File

@ -263,7 +263,6 @@ class Client:
return decorator
# TODO: Maybe make add_handler return (handler, group)?
def add_handler(self, handler, group: int = 0):
"""Use this method to register an update handler.
@ -277,9 +276,14 @@ class Client:
group (``int``, optional):
The group identifier, defaults to 0.
Returns:
A tuple of (handler, group)
"""
self.dispatcher.add_handler(handler, group)
return handler, group
def remove_handler(self, handler, group: int = 0):
"""Removes a previously-added update handler.