CR fix: bugfix with type guard

This commit is contained in:
Yuriy Chebyshev 2022-07-12 21:05:58 +03:00
parent 9b83aa36db
commit 2984c83099

View file

@ -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"
)