From 41e3313288ea896eb69e14d6572719b79cf9dc77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9A=E7=BE=85=E7=8B=BC?= Date: Thu, 18 May 2023 12:29:55 +0800 Subject: [PATCH] Update --- modules/_arcaea/_locales/en_us.json | 2 +- modules/_arcaea/_locales/zh_cn.json | 2 +- modules/_arcaea/_locales/zh_tw.json | 2 +- modules/arcaea/__init__.py | 4 ++-- modules/arcaea/locales/en_us.json | 8 ++++---- modules/arcaea/locales/zh_cn.json | 16 ++++++++-------- modules/arcaea/locales/zh_tw.json | 14 +++++++------- modules/cytoid/__init__.py | 2 +- modules/cytoid/locales/en_us.json | 4 ++-- modules/cytoid/locales/zh_cn.json | 4 ++-- modules/cytoid/locales/zh_tw.json | 4 ++-- modules/cytoid/profile.py | 2 +- modules/phigros/__init__.py | 24 +++++++++++------------- modules/phigros/locales/zh_cn.json | 11 +++++++++++ modules/wiki/set.py | 25 +++++++++++++++---------- 15 files changed, 69 insertions(+), 55 deletions(-) create mode 100644 modules/phigros/locales/zh_cn.json diff --git a/modules/_arcaea/_locales/en_us.json b/modules/_arcaea/_locales/en_us.json index d0181238..9b0ce309 100644 --- a/modules/_arcaea/_locales/en_us.json +++ b/modules/_arcaea/_locales/en_us.json @@ -27,7 +27,7 @@ "arcaea.message.failed.fetch": "Failed to fetch.", "arcaea.message.invalid.friendcode.format": "Please enter the correct friend ID!", "arcaea.message.invalid.friendcode.non_digital": "Friend ID must be 9 digits!", - "arcaea.message.user.unbound": "Unbound user. Please bind user by \"${prefix}arcaea bind \".", + "arcaea.message.user_unbound": "Unbound user. Please bind user by \"${prefix}arcaea bind\".", "arcaea.message.no_webrender": "No webrender configured, this command cannot be used.", "arcaea.b30.help": "Query the best 30 list of Arcaea user. ", "arcaea.b30.message.success": "Result\nBest 30:${b30} | Recent 10:${r10}\nBest 30 last 5 list: \n${last5list}", diff --git a/modules/_arcaea/_locales/zh_cn.json b/modules/_arcaea/_locales/zh_cn.json index 815b400a..812fa559 100644 --- a/modules/_arcaea/_locales/zh_cn.json +++ b/modules/_arcaea/_locales/zh_cn.json @@ -27,7 +27,7 @@ "arcaea.message.failed.fetch": "获取失败。", "arcaea.message.invalid.friendcode.format": "请输入正确的好友 ID!", "arcaea.message.invalid.friendcode.non_digital": "好友 ID 必须是 9 位数字!", - "arcaea.message.user.unbound": "未绑定用户,请使用“${prefix}arcaea bind ”绑定一个用户。", + "arcaea.message.user_unbound": "未绑定用户,请使用“${prefix}arcaea bind ”绑定一个用户。", "arcaea.message.no_webrender": "未配置 webrender,无法使用此命令。", "arcaea.b30.help": "查询 Arcaea 用户的 b30 列表。", "arcaea.b30.message.success": "获取结果\nB30:${b30} | R10:${r10}\nB30 倒 5 列表:\n${last5list}", diff --git a/modules/_arcaea/_locales/zh_tw.json b/modules/_arcaea/_locales/zh_tw.json index c228753b..835a129c 100644 --- a/modules/_arcaea/_locales/zh_tw.json +++ b/modules/_arcaea/_locales/zh_tw.json @@ -27,7 +27,7 @@ "arcaea.message.failed.fetch": "取得失敗。", "arcaea.message.invalid.friendcode.format": "請輸入正確的好友 ID!", "arcaea.message.invalid.friendcode.non_digital": "好友 ID 必須為 9 位數字!", - "arcaea.message.user.unbound": "未綁定使用者,請使用「${prefix}arcaea bind 」綁定一個使用者。", + "arcaea.message.user_unbound": "未綁定使用者,請使用「${prefix}arcaea bind」綁定一個使用者。", "arcaea.message.no_webrender": "未配置 webrender,無法使用此指令。", "arcaea.b30.help": "查詢 Arcaea 使用者的 b30 列表。", "arcaea.b30.message.success": "取得結果\nB30:${b30} | R10:${r10}\nB30 倒 5 列表:\n${last5list}", diff --git a/modules/arcaea/__init__.py b/modules/arcaea/__init__.py index 32774c0b..c66ea946 100644 --- a/modules/arcaea/__init__.py +++ b/modules/arcaea/__init__.py @@ -141,7 +141,7 @@ async def _(msg: Bot.MessageSession): finally: query_tasks.remove(msg.target.senderId) else: - await msg.finish(msg.locale.t("arcaea.message.user.unbound", prefix=msg.prefixes[0])) + await msg.finish(msg.locale.t("arcaea.message.user_unbound", prefix=msg.prefixes[0])) @arc.command('info [] {{arcaea.info.help}}') @@ -164,7 +164,7 @@ async def _(msg: Bot.MessageSession): traceback.print_exc() await msg.finish(msg.locale.t("arcaea.message.failed.fetch")) else: - await msg.finish(msg.locale.t("arcaea.message.user.unbound", prefix=msg.prefixes[0])) + await msg.finish(msg.locale.t("arcaea.message.user_unbound", prefix=msg.prefixes[0])) @arc.command('song {{arcaea.song.help}}') diff --git a/modules/arcaea/locales/en_us.json b/modules/arcaea/locales/en_us.json index 8833e66a..b0d2fb22 100644 --- a/modules/arcaea/locales/en_us.json +++ b/modules/arcaea/locales/en_us.json @@ -5,7 +5,7 @@ "arcaea.rank.help.free": "View the current rank of the free packs.", "arcaea.rank.help.paid": "View the current rank of the paid packs.", "arcaea.help.desc": "Queries about Arcaea.", - "arcaea.message.sb616": "For obvious reasons, score-checking features of the \"arcaea\" module are disabled indefinitely.\nMen are mortal. Unfortunately, Guy's mom has passed away and can no longer answer you. She shall be always remembered.\n", + "arcaea.message.sb616": "\nP.S. Men are mortal. Unfortunately, Guy's mom has passed away and can no longer answer you. She shall be always remembered.\n", "arcaea.errcode.-1": "Invalid username or friend ID", "arcaea.errcode.-2": "Invalid friend ID", "arcaea.errcode.-3": "User not found", @@ -28,13 +28,13 @@ "arcaea.errcode.-20": "File does not exist", "arcaea.errcode.-23": "Internal error occurred", "arcaea.errcode.-233": "Unknown error occurred", - "arcaea.message.assets.not_found": "No resource files found! Please place the apk files of Arcaea to the robot's assets directory and rename them to \"arc.apk\", use \"${prefix}arcaea\" to initialize resources.", + "arcaea.message.assets.not_found": "No resource files found! Please place the apk files of Arcaea to the robot's \"assets\" directory and rename them to \"arc.apk\", use \"${prefix}arcaea\" to initialize resources.", "arcaea.message.failed": "Failed to query.", "arcaea.message.failed.errcode": "Failed to query: ", "arcaea.message.failed.fetch": "Failed to fetch.", "arcaea.message.invalid.friendcode.format": "Please enter the correct friend ID!", "arcaea.message.invalid.friendcode.non_digital": "Friend ID must be 9 digits!", - "arcaea.message.user.unbound": "Unbound user. Please bind user by \"${prefix}arcaea bind \".", + "arcaea.message.user_unbound": "Unbound user. Please bind user by \"${prefix}arcaea bind\".", "arcaea.message.no_webrender": "No webrender configured, this command cannot be used.", "arcaea.b30.help": "Query the best 30 list of Arcaea user. ", "arcaea.b30.message.wait": "已将查询提交给队列,请耐心等待…", @@ -71,6 +71,6 @@ "arcaea.bind.message.failed": "Binding failed, please try binding with your friend ID.", "arcaea.unbind.help": "Unbind user.", "arcaea.unbind.message.success": "Unbind succeeded.", - "arcaea.initialize.message.not_found": "arc.apk not found!", + "arcaea.initialize.message.not_found": "\"arc.apk\" not found!", "arcaea.initialize.message.success": "Initialized successed!" } diff --git a/modules/arcaea/locales/zh_cn.json b/modules/arcaea/locales/zh_cn.json index e377fbc3..ccdea3f7 100644 --- a/modules/arcaea/locales/zh_cn.json +++ b/modules/arcaea/locales/zh_cn.json @@ -1,11 +1,11 @@ { - "arcaea.download.help": "获取最新版本的游戏 apk。", + "arcaea.download.help": "获取最新版本的游戏 Apk。", "arcaea.download.message.success": "目前的最新版本为 ${version}。\n下载地址:${url}", "arcaea.random.help": "随机一首曲子。", "arcaea.rank.help.free": "查看当前免费包游玩排行。", "arcaea.rank.help.paid": "查看当前付费包游玩排行。", "arcaea.help.desc": "查询 Arcaea 相关内容。", - "arcaea.message.sb616": "PS:人生自古谁无死?不幸地,Guy 的母亲已经逝世,因此无法继续与您互动,让我们永远缅怀她。", + "arcaea.message.sb616": "\nPS:人生自古谁无死?不幸地,Guy 的母亲已经逝世,因此无法继续与您互动,让我们永远缅怀她。", "arcaea.errcode.-1": "非法的用户名或好友代码", "arcaea.errcode.-2": "非法的好友代码", "arcaea.errcode.-3": "未找到用户", @@ -28,17 +28,17 @@ "arcaea.errcode.-20": "文件不存在", "arcaea.errcode.-23": "发生了内部错误", "arcaea.errcode.-233": "发生了未知错误", - "arcaea.message.assets.not_found": "找不到资源文件!请放置一份 Arcaea 的 apk 文件到机器人的 assets 目录并重命名为 arc.apk 后,使用“${prefix}arcaea initialize”初始化资源。", + "arcaea.message.assets.not_found": "找不到资源文件!请放置一份 Arcaea 的 Apk 文件到机器人的“assets”目录并重命名为“arc.apk”后,使用“${prefix}arcaea initialize”初始化资源。", "arcaea.message.failed": "查询失败。", "arcaea.message.failed.errcode": "查询失败:", "arcaea.message.failed.fetch": "获取失败。", "arcaea.message.invalid.friendcode.format": "请输入正确的好友 ID!", "arcaea.message.invalid.friendcode.non_digital": "好友 ID 必须是 9 位数字!", - "arcaea.message.user.unbound": "未绑定用户,请使用“${prefix}arcaea bind ”绑定一个用户。", - "arcaea.message.no_webrender": "未配置 webrender,无法使用此命令。", - "arcaea.b30.help": "查询 Arcaea 用户的 b30 列表。", + "arcaea.message.user_unbound": "未绑定用户,请使用“${prefix}arcaea bind”绑定一个用户。", + "arcaea.message.no_webrender": "未配置 Webrender,无法使用此命令。", + "arcaea.b30.help": "查询 Arcaea 用户的 B30 列表。", "arcaea.b30.message.wait": "已将查询提交给队列,请耐心等待…", - "arcaea.b30.message.wait.check": "当前查询用时较长,我们将在30分钟内每分钟检查一次返回的结果,请耐心等待…", + "arcaea.b30.message.wait.check": "当前查询用时较长,我们将在 30 分钟内每分钟检查一次返回的结果,请耐心等待…", "arcaea.b30.message.wait.timeout": "查询超时,建议过一段时间后重试。", "arcaea.b30.message.wait.cached": "你已在 12 小时内提交过一次查询,将使用上次查询缓存的结果。", "arcaea.b30.message.wait.already": "我们正在执行你上次使用的命令中,稍安勿躁…", @@ -72,6 +72,6 @@ "arcaea.bind.message.failed": "绑定失败,请尝试使用好友 ID 绑定。", "arcaea.unbind.help": "解绑用户。", "arcaea.unbind.message.success": "解绑成功。", - "arcaea.initialize.message.not_found": "未找到 arc.apk!", + "arcaea.initialize.message.not_found": "未找到“arc.apk”!", "arcaea.initialize.message.success": "成功初始化!" } diff --git a/modules/arcaea/locales/zh_tw.json b/modules/arcaea/locales/zh_tw.json index df0a66dd..bda34269 100644 --- a/modules/arcaea/locales/zh_tw.json +++ b/modules/arcaea/locales/zh_tw.json @@ -1,11 +1,11 @@ { - "arcaea.download.help": "取得最新版本的遊戲 apk。", + "arcaea.download.help": "取得最新版本的遊戲 Apk。", "arcaea.download.message.success": "目前的最新版本為 ${version}。\n下載網址:${url}", "arcaea.random.help": "隨機一首曲目。", "arcaea.rank.help.free": "檢視目前免費包遊玩排行。", "arcaea.rank.help.paid": "檢視目前付費包遊玩排行。", "arcaea.help.desc": "查詢 Arcaea 相關內容。", - "arcaea.message.sb616": "PS:人生自古誰無死?不幸地,Guy 的母親已經逝世,因此無法繼續與您互動,讓我們永遠緬懷她。", + "arcaea.message.sb616": "\nPS:人生自古誰無死?不幸地,Guy 的母親已經逝世,因此無法繼續與您互動,讓我們永遠緬懷她。", "arcaea.errcode.-1": "無效的使用者名稱或好友 ID", "arcaea.errcode.-2": "無效的好友 ID", "arcaea.errcode.-3": "找不到使用者", @@ -28,15 +28,15 @@ "arcaea.errcode.-20": "檔案不存在", "arcaea.errcode.-23": "發生了內部錯誤", "arcaea.errcode.-233": "發生了不明錯誤", - "arcaea.message.assets.not_found": "找不到資源檔案! 請放置一份 Arcaea 的 apk 檔案到機器人的 assets 目錄並重命名為 arc.apk 後,使用「${prefix}arcaea initialize」初始化資源。", + "arcaea.message.assets.not_found": "找不到資源檔案! 請放置一份 Arcaea 的 Apk 檔案到機器人的「assets」目錄並重命名為「arc.apk」後,使用「${prefix}arcaea initialize」初始化資源。", "arcaea.message.failed": "查詢失敗。", "arcaea.message.failed.errcode": "查詢失敗:", "arcaea.message.failed.fetch": "取得失敗。", "arcaea.message.invalid.friendcode.format": "請輸入正確的好友 ID!", "arcaea.message.invalid.friendcode.non_digital": "好友 ID 必須為 9 位數字!", - "arcaea.message.user.unbound": "未綁定使用者,請使用「${prefix}arcaea bind 」綁定一個使用者。", - "arcaea.message.no_webrender": "未配置 webrender,無法使用此指令。", - "arcaea.b30.help": "查詢 Arcaea 使用者的 b30 列表。", + "arcaea.message.user_unbound": "未綁定使用者,請使用「${prefix}arcaea bind」綁定一個使用者。", + "arcaea.message.no_webrender": "未配置 Webrender,無法使用此指令。", + "arcaea.b30.help": "查詢 Arcaea 使用者的 B30 列表。", "arcaea.b30.message.wait": "已将查询提交给队列,请耐心等待…", "arcaea.b30.message.wait.check": "当前查询用时较长,我们将在30分钟内每分钟检查一次返回的结果,请耐心等待…", "arcaea.b30.message.wait.timeout": "查询超时,建议过一段时间后重试。", @@ -71,6 +71,6 @@ "arcaea.bind.message.failed": "綁定失敗,請嘗試使用好友 ID 綁定。", "arcaea.unbind.help": "解除綁定使用者。", "arcaea.unbind.message.success": "解除綁定成功。", - "arcaea.initialize.message.not_found": "找不到 arc.apk!", + "arcaea.initialize.message.not_found": "找不到「arc.apk」!", "arcaea.initialize.message.success": "成功初始化!" } diff --git a/modules/cytoid/__init__.py b/modules/cytoid/__init__.py index 87bbb5e2..ceda511e 100644 --- a/modules/cytoid/__init__.py +++ b/modules/cytoid/__init__.py @@ -53,7 +53,7 @@ async def _(msg: Bot.MessageSession): @cytoid.handle('bind {{cytoid.bind.help}}') async def _(msg: Bot.MessageSession): - code: str = msg.parsed_msg[''] + code: str = lower(msg.parsed_msg['']) getcode = await get_profile_name(code) if getcode: bind = CytoidBindInfoManager(msg).set_bind_info(username=getcode[0]) diff --git a/modules/cytoid/locales/en_us.json b/modules/cytoid/locales/en_us.json index 257f1db7..8ef76e40 100644 --- a/modules/cytoid/locales/en_us.json +++ b/modules/cytoid/locales/en_us.json @@ -1,13 +1,13 @@ { "cytoid.profile.help": "查询一个用户的基本信息。", - "cytoid.b30.help": "查询 Cytoid 用户的 b30/r30 列表。", + "cytoid.b30.help": "查询 Cytoid 用户的 B30/R30 列表。", "cytoid.b30.message.cooldown": "距离上次执行已过去 ${time} 秒,本命令的冷却时间为 150 秒。(据官方人员所述,此 API 的调用十分昂贵,故手动做出这一限制,请谅解。)", "cytoid.bind.help": "绑定 Cytoid 用户。", "cytoid.bind.message.success": "绑定成功:", "cytoid.bind.message.failed": "绑定失败,请检查输入。", "cytoid.unbind.help": "解绑用户。", "cytoid.unbind.message.success": "解绑成功。", - "cytoid.message.user.unbound": "未绑定用户,请使用“${prefix}cytoid bind ”绑定一个用户。", + "cytoid.message.user.unbound": "未绑定用户,请使用“${prefix}cytoid bind”绑定一个用户。", "cytoid.message.user.not_found": "用户不存在。", "cytoid.message.error.user.not_found": "发生错误:此用户不存在。" } \ No newline at end of file diff --git a/modules/cytoid/locales/zh_cn.json b/modules/cytoid/locales/zh_cn.json index 257f1db7..8ef76e40 100644 --- a/modules/cytoid/locales/zh_cn.json +++ b/modules/cytoid/locales/zh_cn.json @@ -1,13 +1,13 @@ { "cytoid.profile.help": "查询一个用户的基本信息。", - "cytoid.b30.help": "查询 Cytoid 用户的 b30/r30 列表。", + "cytoid.b30.help": "查询 Cytoid 用户的 B30/R30 列表。", "cytoid.b30.message.cooldown": "距离上次执行已过去 ${time} 秒,本命令的冷却时间为 150 秒。(据官方人员所述,此 API 的调用十分昂贵,故手动做出这一限制,请谅解。)", "cytoid.bind.help": "绑定 Cytoid 用户。", "cytoid.bind.message.success": "绑定成功:", "cytoid.bind.message.failed": "绑定失败,请检查输入。", "cytoid.unbind.help": "解绑用户。", "cytoid.unbind.message.success": "解绑成功。", - "cytoid.message.user.unbound": "未绑定用户,请使用“${prefix}cytoid bind ”绑定一个用户。", + "cytoid.message.user.unbound": "未绑定用户,请使用“${prefix}cytoid bind”绑定一个用户。", "cytoid.message.user.not_found": "用户不存在。", "cytoid.message.error.user.not_found": "发生错误:此用户不存在。" } \ No newline at end of file diff --git a/modules/cytoid/locales/zh_tw.json b/modules/cytoid/locales/zh_tw.json index 9c792f65..7ab987a5 100644 --- a/modules/cytoid/locales/zh_tw.json +++ b/modules/cytoid/locales/zh_tw.json @@ -1,13 +1,13 @@ { "cytoid.profile.help": "查詢一個使用者的基本資訊。", - "cytoid.b30.help": "查詢 Cytoid 使用者的 b30/r30 列表。", + "cytoid.b30.help": "查詢 Cytoid 使用者的 B30/R30 列表。", "cytoid.b30.message.cooldown": "距离上次执行已过去 ${time} 秒,本命令的冷却时间为 150 秒。(据官方人员所述,此 API 的调用十分昂贵,故手动做出这一限制,请谅解。)", "cytoid.bind.help": "绑定 Cytoid 使用者。", "cytoid.bind.message.success": "綁定成功。", "cytoid.bind.message.failed": "綁定失敗,請檢查輸入。", "cytoid.unbind.help": "解除綁定使用者。", "cytoid.unbind.message.success": "解除綁定成功。", - "cytoid.message.user.unbound": "未綁定使用者,請使用「${prefix}cytoid bind 」綁定一個使用者。", + "cytoid.message.user.unbound": "未綁定使用者,請使用「${prefix}cytoid bind」綁定一個使用者。", "cytoid.message.user.not_found": "使用者不存在。", "cytoid.message.error.user.not_found": "發生錯誤:此使用者不存在。" } \ No newline at end of file diff --git a/modules/cytoid/profile.py b/modules/cytoid/profile.py index 3237448e..c2909ad2 100644 --- a/modules/cytoid/profile.py +++ b/modules/cytoid/profile.py @@ -7,7 +7,7 @@ from .dbutils import CytoidBindInfoManager async def cytoid_profile(msg: Bot.MessageSession): - pat = msg.parsed_msg.get('', False) + pat = lower(msg.parsed_msg.get('', False)) if pat: query_id = pat else: diff --git a/modules/phigros/__init__.py b/modules/phigros/__init__.py index dd072d45..c4716041 100644 --- a/modules/phigros/__init__.py +++ b/modules/phigros/__init__.py @@ -14,41 +14,39 @@ from .dbutils import PgrBindInfoManager from .update import update_difficulty_csv, update_assets from .genb19 import drawb19 -phi = module('phigros', developers=['OasisAkari'], desc='查询 Phigros 相关内容。SessionToken获取参考:' - 'https://mivik.gitee.io/pgr-bot-help/index.html#%E5%AE%89%E5%8D%93', +phi = module('phigros', developers=['OasisAkari'], desc='{phigros.help.desc}', alias={'p': 'phigros', 'pgr': 'phigros', 'phi': 'phigros'}) -@phi.command('bind {使用云存档SessionToken绑定一个账户。(请在私聊绑定账户)}') +@phi.command('bind {{phigros.help.bind}}') async def _(msg: Bot.MessageSession): need_revoke = False send_msg = [] if msg.target.targetFrom in ['QQ|Group', 'QQ|Guild', 'Discord|Channel', 'Telegram|group', 'Telegram|supergroup']: - send_msg.append(await msg.sendMessage('警告:您正在群组中绑定账户,这有可能会使您的账户云存档数据被他人篡改。请尽量使用私聊绑定账户以避免这种情况。\n' - '您可以通过重新登录重置SessionToken,此次命令产生的消息将在15秒后撤回。')) + send_msg.append(await msg.sendMessage(msg.locale.t("phigros.bind.message.warning"))) need_revoke = True token: str = msg.parsed_msg[''] bind = PgrBindInfoManager(msg).set_bind_info(sessiontoken=token) if bind: - send_msg.append(await msg.sendMessage("成功绑定账户。")) + send_msg.append(await msg.sendMessage(msg.locale.t("phigros.bind.message.success"))) if need_revoke: await msg.sleep(15) for i in send_msg: await i.delete() -@phi.command('unbind {取消绑定账户。}') +@phi.command('unbind {{phigros.unbind.help}}') async def _(msg: Bot.MessageSession): unbind = PgrBindInfoManager(msg).remove_bind_info() if unbind: - await msg.finish("成功取消绑定账户。") + await msg.finish(msg.locale.t("phigros.unbind.message.success")) -@phi.command('b19 {查询B19信息。}') +@phi.command('b19 {{phigros.b19.help}}') async def _(msg: Bot.MessageSession): bind = PgrBindInfoManager(msg).get_bind_sessiontoken() if bind is None: - await msg.finish("您还未绑定账户。") + await msg.finish(msg.locale.t("phigros.message.user_unbound")) else: transport = TTransport.TBufferedTransport(TSocket.TSocket()) protocol = TBinaryProtocol.TBinaryProtocol(transport) @@ -57,20 +55,20 @@ async def _(msg: Bot.MessageSession): saveurl = client.getSaveUrl(bind) result = client.best19(saveurl.saveUrl) transport.close() - await msg.sendMessage([Plain('查询结果:\n'), Image(drawb19('', result))]) + await msg.sendMessage(Image(drawb19('', result))) @phi.command('update assets') async def _(msg: Bot.MessageSession): update_ = await update_assets() if update_: - await msg.finish("更新成功。") + await msg.finish(msg.locale.t("phigros.message.update.success")) @phi.command('update rating') async def _(msg: Bot.MessageSession): update_ = await update_difficulty_csv() if update_: - await msg.finish("更新成功。") + await msg.finish(msg.locale.t("phigros.message.update.success")) diff --git a/modules/phigros/locales/zh_cn.json b/modules/phigros/locales/zh_cn.json new file mode 100644 index 00000000..84c50c03 --- /dev/null +++ b/modules/phigros/locales/zh_cn.json @@ -0,0 +1,11 @@ +{ + "phigros.help.desc": "查询 Phigros 相关内容。", + "phigros.help.bind": "使用云存档 SessionToken 绑定用户,建议私聊使用。", + "phigros.bind.message.warning": "警告:您正在群组中绑定用户,这有可能会使您的用户云存档数据被他人篡改。请尽量私聊绑定用户以避免这种情况。\n您可以通过重新登录来重置 SessionToken。此次命令产生的消息将在 15 秒后撤回。", + "phigros.bind.message.success": "绑定成功。", + "phigros.unbind.help": "解绑用户。", + "phigros.unbind.message.success": "解绑成功。", + "phigros.b19.help": "查询 B19 列表。", + "phigros.message.user_unbound": "未绑定用户,请使用「${prefix}phigros bind」绑定一个用户。", + "phigros.message.update.success": "更新成功。" +} \ No newline at end of file diff --git a/modules/wiki/set.py b/modules/wiki/set.py index 0a0f6884..3e209d2f 100644 --- a/modules/wiki/set.py +++ b/modules/wiki/set.py @@ -154,23 +154,28 @@ async def _(msg: Bot.MessageSession): await msg.finish(msg.locale.t("wiki.prefix.reset.message.success")) -@wiki.handle('fandom enable {{wiki.fandom.enable.help}}', 'fandom disable {{wiki.fandom.disable.help}}', +@wiki.handle('fandom {{wiki.fandom.enable.help}}', required_admin=True) async def _(msg: Bot.MessageSession): - if msg.parsed_msg.get('enable', False): - msg.data.edit_option('wiki_fandom_addon', True) - await msg.finish(msg.locale.t("wiki.fandom.enable.message")) - else: + + fandom_addon_state = msg.data.edit_option('wiki_fandom_addon', False) + + if fandom_addon_state: msg.data.edit_option('wiki_fandom_addon', False) await msg.finish(msg.locale.t("wiki.fandom.disable.message")) + else: + msg.data.edit_option('wiki_fandom_addon', True) + await msg.finish(msg.locale.t("wiki.fandom.enable.message")) -@wiki.handle('redlink enable {{wiki.redlink.enable.help}}', 'redlink disable {{wiki.redlink.disable.help}}', +@wiki.handle('redlink {{wiki.redlink.enable.help}}', required_admin=True) async def _(msg: Bot.MessageSession): - if msg.parsed_msg.get('enable', False): - msg.data.edit_option('wiki_redlink', True) - await msg.finish(msg.locale.t("wiki.redlink.enable.message")) - else: + redlink_state = msg.data.edit_option('wiki_redlink', False) + + if redlink_state: msg.data.edit_option('wiki_redlink', False) await msg.finish(msg.locale.t("wiki.redlink.disable.message")) + else: + msg.data.edit_option('wiki_redlink', True) + await msg.finish(msg.locale.t("wiki.redlink.enable.message"))