mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-01-19 09:38:21 +08:00
Add comment
This commit is contained in:
parent
368b6290b3
commit
73838ac46a
@ -15,6 +15,21 @@ class ValidateError(ValueError):
|
||||
|
||||
async def run_arg_filters(session: 'CommandSession',
|
||||
arg_filters: List[ArgFilter_T]) -> None:
|
||||
"""
|
||||
Run a specific list of argument filters on a command session.
|
||||
|
||||
This will call all argument filter functions successively,
|
||||
with `session.current_arg` as the argument.
|
||||
|
||||
If all filters are passed, the final result will be put into
|
||||
`session.state` with the key `session.current_key`.
|
||||
|
||||
If some validation failed, the session will be paused and
|
||||
failure message will be sent to the user.
|
||||
|
||||
:param session: command session to run on
|
||||
:param arg_filters: argument filters
|
||||
"""
|
||||
arg = session.current_arg
|
||||
for f in arg_filters:
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user