From 0ecaa57230c9f2435f12a6774bb8b34d9cd972e4 Mon Sep 17 00:00:00 2001 From: Richard Chien Date: Fri, 25 Jan 2019 22:30:35 +0800 Subject: [PATCH] Fix detail behavior --- nonebot/command/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nonebot/command/__init__.py b/nonebot/command/__init__.py index 40edc164..1a9f622b 100644 --- a/nonebot/command/__init__.py +++ b/nonebot/command/__init__.py @@ -97,8 +97,9 @@ class Command: # fallback to command-level args_parser_func if self.args_parser_func: await self.args_parser_func(session) - elif session.current_key is not None: - # no args_parser_func, fallback to default behavior + if session.current_key is not None and \ + session.current_key not in session.state: + # args_parser_func didn't set state, here we set it session.state[session.current_key] = session.current_arg await self.func(session)