diff --git a/none/command/__init__.py b/none/command/__init__.py index 368f153c..294871a3 100644 --- a/none/command/__init__.py +++ b/none/command/__init__.py @@ -188,7 +188,7 @@ class _FurtherInteractionNeeded(Exception): class CommandSession(BaseSession): __slots__ = ('cmd', 'current_key', 'current_arg', 'current_arg_text', - 'images', 'args', 'last_interaction') + 'current_arg_images', 'args', 'last_interaction') def __init__(self, bot: CQHttp, ctx: Dict[str, Any], cmd: Command, *, current_arg: str = '', args: Optional[Dict[str, Any]] = None): @@ -197,8 +197,8 @@ class CommandSession(BaseSession): self.current_key = None self.current_arg = current_arg self.current_arg_text = Message(current_arg).extract_plain_text() - self.images = [s.data['url'] for s in ctx['message'] - if s.type == 'image' and 'url' in s.data] + self.current_arg_images = [s.data['url'] for s in ctx['message'] + if s.type == 'image' and 'url' in s.data] self.args = args or {} self.last_interaction = None @@ -212,8 +212,8 @@ class CommandSession(BaseSession): self.ctx = ctx self.current_arg = current_arg self.current_arg_text = Message(current_arg).extract_plain_text() - self.images = [s.data['url'] for s in ctx['message'] - if s.type == 'image' and 'url' in s.data] + self.current_arg_images = [s.data['url'] for s in ctx['message'] + if s.type == 'image' and 'url' in s.data] @property def is_valid(self) -> bool: diff --git a/none/plugins/base.py b/none/plugins/base.py index 356c3030..bc47eea2 100644 --- a/none/plugins/base.py +++ b/none/plugins/base.py @@ -6,9 +6,10 @@ from none.command import permissions as perm @on_command('echo', only_to_me=False) async def echo(session: CommandSession): - await session.send(session.current_arg) + await session.send(session.args.get('text') or session.current_arg) @on_command('say', permission=perm.SUPERUSER, only_to_me=False) async def _(session: CommandSession): - await session.send(unescape(session.current_arg)) + await session.send( + unescape(session.args.get('text') or session.current_arg))