From 2984c830994c4bdb8a4379a14577b475e5a76e9b Mon Sep 17 00:00:00 2001 From: Yuriy Chebyshev Date: Tue, 12 Jul 2022 21:05:58 +0300 Subject: [PATCH] CR fix: bugfix with type guard --- aiogram/dispatcher/filters/builtin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aiogram/dispatcher/filters/builtin.py b/aiogram/dispatcher/filters/builtin.py index c46c26cc..cdf58ee0 100644 --- a/aiogram/dispatcher/filters/builtin.py +++ b/aiogram/dispatcher/filters/builtin.py @@ -69,7 +69,7 @@ class Command(Filter): if isinstance(commands, (str, BotCommand)): commands = (commands,) elif isinstance(commands, Iterable): - if not all(map(lambda cmd: isinstance(cmd, str), commands)): + if not all(map(lambda cmd: isinstance(cmd, (str, BotCommand)), commands)): raise ValueError( "Command filter only supports str, BotCommand object or their Iterable" )