mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
CR fix: bugfix with type guard
This commit is contained in:
parent
9b83aa36db
commit
2984c83099
1 changed files with 1 additions and 1 deletions
|
|
@ -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"
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue