From ba5cbfcc687cb263d6e0b857214b7b9a1eefce6f Mon Sep 17 00:00:00 2001 From: xtaodada Date: Sat, 4 Jun 2022 14:11:59 +0800 Subject: [PATCH] update --- plugins/bind.py | 12 ++++++++---- plugins/refresh.py | 3 +++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/plugins/bind.py b/plugins/bind.py index 3ea0888..e0548f4 100644 --- a/plugins/bind.py +++ b/plugins/bind.py @@ -9,9 +9,13 @@ from ci import app, me async def bind_command(_: Client, message: Message): if len(message.command) == 1: if check_bind(message.from_user.id): - data = Player(get_bind_uid(message.from_user.id)) + uid = get_bind_uid(message.from_user.id) + if len(message.command) == 1: + if message.command[1].isnumeric(): + uid = message.command[1] + data = Player(uid) data.restore() - return await message.reply(f"您绑定的游戏 uid 为:{get_bind_uid(message.from_user.id)}\n\n" + return await message.reply(f"游戏 uid 为 {uid} 的角色缓存有:\n\n" f"{data.gen_all_char()}", quote=True) else: return await message.reply(f"请使用 /bind [uid] 绑定游戏 uid", quote=True) @@ -22,5 +26,5 @@ async def bind_command(_: Client, message: Message): return await message.reply("uid 非数字", quote=True) uid = message.command[1] set_bind(message.from_user.id, uid) - msg = await message.reply(f"绑定成功,您绑定的游戏 uid 为:{uid}\n\n" - f"请将角色放入展柜,开启显示详细信息后,使用 /refresh 刷新数据。", quote=True) + await message.reply(f"绑定成功,您绑定的游戏 uid 为:{uid}\n\n" + f"请将角色放入展柜,开启显示详细信息后,使用 /refresh 刷新数据。", quote=True) diff --git a/plugins/refresh.py b/plugins/refresh.py index c7a9358..1352e05 100644 --- a/plugins/refresh.py +++ b/plugins/refresh.py @@ -10,6 +10,9 @@ async def refresh_command(_: Client, message: Message): if not check_bind(message.from_user.id): return await message.reply(f"请使用 /bind [uid] 绑定游戏 uid", quote=True) uid = get_bind_uid(message.from_user.id) + if len(message.command) == 1: + if message.command[1].isnumeric(): + uid = message.command[1] msg = await message.reply(f"正在刷新数据,请稍等。。。", quote=True) text = await refresh_player(uid) await msg.edit(text)