Add comment

This commit is contained in:
Richard Chien 2019-01-25 13:29:15 +08:00
parent 368b6290b3
commit 73838ac46a

View File

@ -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: