From 24b176389c2b765699319c10114afdb9ceefae57 Mon Sep 17 00:00:00 2001 From: LWR Date: Wed, 19 Jul 2023 21:06:27 +0800 Subject: [PATCH] docs: Optimized commands tips --- starbot/commands/builtin/data/bind.py | 4 ++-- starbot/commands/builtin/data/room_data.py | 4 ++++ starbot/commands/builtin/data/room_data_total.py | 4 ++++ starbot/commands/builtin/data/user_data.py | 4 ++++ starbot/commands/builtin/data/user_data_total.py | 4 ++++ 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/starbot/commands/builtin/data/bind.py b/starbot/commands/builtin/data/bind.py index 91d21f9..8ce80b3 100644 --- a/starbot/commands/builtin/data/bind.py +++ b/starbot/commands/builtin/data/bind.py @@ -42,7 +42,7 @@ async def bind(app: Ariadne, uid = remove_command_param_placeholder(uid.display) if not uid.isdigit() or int(uid) == 0: - await app.send_message(sender, MessageChain("请输入正确的UID~"), quote=source) + await app.send_message(sender, MessageChain(f"请输入正确的UID~\n命令示例:{prefix}绑定 114514"), quote=source) return if isinstance(sender, Friend): @@ -78,7 +78,7 @@ async def bind(app: Ariadne, if wait_qq == qq: nonlocal source source = wait_source - if wait_msg.display == f"{prefix}确认绑定": + if wait_msg.display == f"{prefix}确认绑定" or wait_msg.display == f"{prefix}确定绑定": return True else: return False diff --git a/starbot/commands/builtin/data/room_data.py b/starbot/commands/builtin/data/room_data.py index 1ddacd1..becb0f0 100644 --- a/starbot/commands/builtin/data/room_data.py +++ b/starbot/commands/builtin/data/room_data.py @@ -40,6 +40,10 @@ async def room_data(app: Ariadne, source: Source, sender: Union[Friend, Group]): ups = datasource.get_ups_by_target(sender.id, PushType.Group if isinstance(sender, Group) else PushType.Friend) if not ups: + if isinstance(sender, Group): + await app.send_message(sender, MessageChain("本群未关联直播间~"), quote=source) + else: + await app.send_message(sender, MessageChain("此处未关联直播间~"), quote=source) return for up in ups: diff --git a/starbot/commands/builtin/data/room_data_total.py b/starbot/commands/builtin/data/room_data_total.py index 7866a60..1efadd1 100644 --- a/starbot/commands/builtin/data/room_data_total.py +++ b/starbot/commands/builtin/data/room_data_total.py @@ -40,6 +40,10 @@ async def room_data_total(app: Ariadne, source: Source, sender: Union[Friend, Gr ups = datasource.get_ups_by_target(sender.id, PushType.Group if isinstance(sender, Group) else PushType.Friend) if not ups: + if isinstance(sender, Group): + await app.send_message(sender, MessageChain("本群未关联直播间~"), quote=source) + else: + await app.send_message(sender, MessageChain("此处未关联直播间~"), quote=source) return for up in ups: diff --git a/starbot/commands/builtin/data/user_data.py b/starbot/commands/builtin/data/user_data.py index 5ba747c..4e9b1be 100644 --- a/starbot/commands/builtin/data/user_data.py +++ b/starbot/commands/builtin/data/user_data.py @@ -40,6 +40,10 @@ async def user_data(app: Ariadne, source: Source, sender: Union[Friend, Group], ups = datasource.get_ups_by_target(sender.id, PushType.Group if isinstance(sender, Group) else PushType.Friend) if not ups: + if isinstance(sender, Group): + await app.send_message(sender, MessageChain("本群未关联直播间~"), quote=source) + else: + await app.send_message(sender, MessageChain("此处未关联直播间~"), quote=source) return if isinstance(sender, Friend): diff --git a/starbot/commands/builtin/data/user_data_total.py b/starbot/commands/builtin/data/user_data_total.py index 9b8603c..c83ae67 100644 --- a/starbot/commands/builtin/data/user_data_total.py +++ b/starbot/commands/builtin/data/user_data_total.py @@ -40,6 +40,10 @@ async def user_data_total(app: Ariadne, source: Source, sender: Union[Friend, Gr ups = datasource.get_ups_by_target(sender.id, PushType.Group if isinstance(sender, Group) else PushType.Friend) if not ups: + if isinstance(sender, Group): + await app.send_message(sender, MessageChain("本群未关联直播间~"), quote=source) + else: + await app.send_message(sender, MessageChain("此处未关联直播间~"), quote=source) return if isinstance(sender, Friend):