mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
fix: CommandStart(deep_link=False) now rejects deep-link arguments (#1790)
Previously the deep_link parameter only had two effective states: False (default) accepted any /start command regardless of arguments, and True required arguments to be present. Change the default to None (accept both, backward compatible) so that False can mean "reject if deep-link arguments are present", which is the intuitive expectation when explicitly passing deep_link=False. Closes #1713 Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
d5bd0b98a3
commit
0611d0d953
3 changed files with 12 additions and 3 deletions
|
|
@ -85,6 +85,9 @@ class TestCommandFilter:
|
|||
False,
|
||||
],
|
||||
["/start test", CommandStart(), True],
|
||||
["/start", CommandStart(), True],
|
||||
["/start", CommandStart(deep_link=False), True],
|
||||
["/start test", CommandStart(deep_link=False), False],
|
||||
["/start", CommandStart(deep_link=True), False],
|
||||
["/start test", CommandStart(deep_link=True), True],
|
||||
["/start test", CommandStart(deep_link=True, deep_link_encoded=True), False],
|
||||
|
|
@ -175,7 +178,7 @@ class TestCommandStart:
|
|||
cmd = CommandStart()
|
||||
assert (
|
||||
str(cmd)
|
||||
== "CommandStart(ignore_case=False, ignore_mention=False, deep_link=False, deep_link_encoded=False)"
|
||||
== "CommandStart(ignore_case=False, ignore_mention=False, deep_link_encoded=False)"
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue