From 6e964b51b157733b7ff84a4180c3469af57eb462 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Mon, 24 Dec 2018 14:50:04 +0100 Subject: [PATCH] Type hint on_message decorator --- pyrogram/client/methods/decorators/on_message.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyrogram/client/methods/decorators/on_message.py b/pyrogram/client/methods/decorators/on_message.py index 68ed1fab..a252c6ba 100644 --- a/pyrogram/client/methods/decorators/on_message.py +++ b/pyrogram/client/methods/decorators/on_message.py @@ -16,8 +16,11 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see . +from typing import Tuple + import pyrogram from pyrogram.client.filters.filter import Filter +from pyrogram.client.handlers.handler import Handler from ...ext import BaseClient @@ -45,7 +48,7 @@ class OnMessage(BaseClient): The group identifier, defaults to 0. """ - def decorator(func): + def decorator(func: callable) -> Tuple[Handler, int]: if isinstance(func, tuple): func = func[0].callback