mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-29 04:43:45 +03:00
Fix typehint for callback in UpdateMethods (#3119)
This commit is contained in:
parent
e2d97b44c5
commit
196cef66fd
|
@ -16,6 +16,8 @@ if typing.TYPE_CHECKING:
|
||||||
from .telegramclient import TelegramClient
|
from .telegramclient import TelegramClient
|
||||||
|
|
||||||
|
|
||||||
|
Callback = typing.Callable[[typing.Any], typing.Any]
|
||||||
|
|
||||||
class UpdateMethods:
|
class UpdateMethods:
|
||||||
|
|
||||||
# region Public methods
|
# region Public methods
|
||||||
|
@ -104,7 +106,7 @@ class UpdateMethods:
|
||||||
|
|
||||||
def add_event_handler(
|
def add_event_handler(
|
||||||
self: 'TelegramClient',
|
self: 'TelegramClient',
|
||||||
callback: callable,
|
callback: Callback,
|
||||||
event: EventBuilder = None):
|
event: EventBuilder = None):
|
||||||
"""
|
"""
|
||||||
Registers a new event handler callback.
|
Registers a new event handler callback.
|
||||||
|
@ -153,7 +155,7 @@ class UpdateMethods:
|
||||||
|
|
||||||
def remove_event_handler(
|
def remove_event_handler(
|
||||||
self: 'TelegramClient',
|
self: 'TelegramClient',
|
||||||
callback: callable,
|
callback: Callback,
|
||||||
event: EventBuilder = None) -> int:
|
event: EventBuilder = None) -> int:
|
||||||
"""
|
"""
|
||||||
Inverse operation of `add_event_handler()`.
|
Inverse operation of `add_event_handler()`.
|
||||||
|
@ -191,7 +193,7 @@ class UpdateMethods:
|
||||||
return found
|
return found
|
||||||
|
|
||||||
def list_event_handlers(self: 'TelegramClient')\
|
def list_event_handlers(self: 'TelegramClient')\
|
||||||
-> 'typing.Sequence[typing.Tuple[callable, EventBuilder]]':
|
-> 'typing.Sequence[typing.Tuple[Callback, EventBuilder]]':
|
||||||
"""
|
"""
|
||||||
Lists all registered event handlers.
|
Lists all registered event handlers.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user