mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-04 06:14:51 +00:00
Type hint on_message decorator
This commit is contained in:
parent
7881320a88
commit
6e964b51b1
1 changed files with 4 additions and 1 deletions
|
|
@ -16,8 +16,11 @@
|
|||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue