From 910c6cacb0878d1f00854d4b36e4b13efcfa97dd Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 20 Jan 2022 01:04:13 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Ability=20to=20run=20multiple=20han?= =?UTF-8?q?dlers=20=F0=9F=90=9B=20Fix=20filter=20type=20hint?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyrogram/dispatcher.py | 1 - pyrogram/filters.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pyrogram/dispatcher.py b/pyrogram/dispatcher.py index 0c425f4d..9bedb268 100644 --- a/pyrogram/dispatcher.py +++ b/pyrogram/dispatcher.py @@ -234,7 +234,6 @@ class Dispatcher: except Exception as e: log.error(e, exc_info=True) - break except pyrogram.StopPropagation: pass except Exception as e: diff --git a/pyrogram/filters.py b/pyrogram/filters.py index 46ca896f..8e48a2c6 100644 --- a/pyrogram/filters.py +++ b/pyrogram/filters.py @@ -18,7 +18,7 @@ import inspect import re -from typing import Callable, Union, List, Pattern +from typing import Callable, Union, List, Pattern, Tuple import pyrogram from pyrogram.types import Message, CallbackQuery, InlineQuery, InlineKeyboardMarkup, ReplyKeyboardMarkup, Update @@ -749,7 +749,7 @@ linked_channel = create(linked_channel_filter) username = None -def command(commands: Union[str, List[str]], prefixes: Union[str, List[str]] = "/", case_sensitive: bool = False): +def command(commands: Union[str, List[str], Tuple[str]], prefixes: Union[str, List[str]] = "/", case_sensitive: bool = False): """Filter commands, i.e.: text messages starting with "/" or any other custom prefix. Parameters: