From 78d48fb163935803a586eabdaf54b3c265e2bbae Mon Sep 17 00:00:00 2001 From: Richard Chien Date: Fri, 25 Jan 2019 18:51:42 +0800 Subject: [PATCH] Rearrange some code --- nonebot/command/__init__.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/nonebot/command/__init__.py b/nonebot/command/__init__.py index 62779121..6b463cd8 100644 --- a/nonebot/command/__init__.py +++ b/nonebot/command/__init__.py @@ -288,14 +288,6 @@ class CommandSession(BaseSession): def is_first_run(self) -> bool: return self._last_interaction is None - @property - def argv(self) -> List[str]: - """ - Shell-like argument list, similar to sys.argv. - Only available while shell_like is True in on_command decorator. - """ - return self.state.get('argv', []) - @property def current_arg_text(self) -> str: """ @@ -318,6 +310,14 @@ class CommandSession(BaseSession): ] return self._current_arg_images + @property + def argv(self) -> List[str]: + """ + Shell-like argument list, similar to sys.argv. + Only available while shell_like is True in on_command decorator. + """ + return self.state.get('argv', []) + def refresh(self, ctx: Context_T, *, current_arg: str = '') -> None: """ Refill the session with a new message context.