Archived
1
0
Fork 0

Merge branch 'Teahouse-Studios:master' into master

This commit is contained in:
ZoruaFox 2023-11-19 02:23:09 +08:00 committed by GitHub
commit 109f8ce6cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 69 additions and 74 deletions

View file

@ -354,7 +354,7 @@ pip3 install matrix-nio[e2e] ; PIP
如有需求,请前往阿里云进行开通并获取 AccessKeyID 及 AccessKeySecret。未填写字段将不会使用屏蔽词服务。 如有需求,请前往阿里云进行开通并获取 AccessKeyID 及 AccessKeySecret。未填写字段将不会使用屏蔽词服务。
另请注意注意,由于阿里云政策限制,内容安全服务**不面向个人开发者**若账号未完成阿里云企业认证即使生成AccessKey也不会调用相关接口。 另请注意,由于阿里云政策限制,内容安全服务**不面向个人开发者**,若账号未完成阿里云企业认证,即使生成 AccessKey 也不会调用相关接口。
`check_accessKeyId =` - 填写获取的 AccessKeyID。 `check_accessKeyId =` - 填写获取的 AccessKeyID。
@ -522,16 +522,8 @@ pip3 install matrix-nio[e2e] ; PIP
您可能需要使用 `poetry shell` 切换 poetry 的虚拟环境来调用先前安装的依赖。 您可能需要使用 `poetry shell` 切换 poetry 的虚拟环境来调用先前安装的依赖。
**Windows**
1. 于 `console.py` 所在目录,按下 `Shift` + `右键` 来打开右键菜单。
2. 选择 `在此处打开 Powershell 窗口``在此处打开命令窗口`
3. 于终端内输入 `python console.py` 来启动测试控制台。
**Linux**
1. 于 `console.py` 所在目录,打开终端。 1. 于 `console.py` 所在目录,打开终端。
2. 终端内输入 `python console.py` 来启动测试控制台。 2. 在终端内输入 `python console.py` 来启动测试控制台。
# 获取帮助 # 获取帮助

View file

@ -269,6 +269,8 @@ pip3 install matrix-nio[e2e] ; PIP
如有需求,请前往阿里云进行开通并获取 AccessKeyID 及 AccessKeySecret。未填写字段将不会使用屏蔽词服务。 如有需求,请前往阿里云进行开通并获取 AccessKeyID 及 AccessKeySecret。未填写字段将不会使用屏蔽词服务。
另请注意,由于阿里云政策限制,内容安全服务**不面向个人开发者**,若账号未完成阿里云企业认证,即使生成 AccessKey 也不会调用相关接口。
`check_accessKeyId =` - 填写获取的 AccessKeyID。 `check_accessKeyId =` - 填写获取的 AccessKeyID。
`check_accessKeySecret =` - 填写获取的 AccessKeySecret。 `check_accessKeySecret =` - 填写获取的 AccessKeySecret。

View file

@ -368,6 +368,8 @@ async def parser(msg: Bot.MessageSession, require_enable_modules: bool = True, p
await msg.send_message(msg.locale.t('error.module.unloaded', module=command_first_word)) await msg.send_message(msg.locale.t('error.module.unloaded', module=command_first_word))
return msg return msg
if msg.muted:
return
if running_mention: if running_mention:
if msg.trigger_msg.find('小可') != -1: if msg.trigger_msg.find('小可') != -1:
if ExecutionLockList.check(msg): if ExecutionLockList.check(msg):

View file

@ -19,7 +19,7 @@
"error.message.paused": "Group message delivering was blocked by the server. Group message delivering is suspended. Use \"${prefix}resume\" to resume pushing.", "error.message.paused": "Group message delivering was blocked by the server. Group message delivering is suspended. Use \"${prefix}resume\" to resume pushing.",
"error.message.report": "The following error occurred while executing \"${module}\": ", "error.message.report": "The following error occurred while executing \"${module}\": ",
"error.message.timeout": "An error occurred: Message sending timed out. Please retry the command later or wait for the result to be returned.", "error.message.timeout": "An error occurred: Message sending timed out. Please retry the command later or wait for the result to be returned.",
"error.module.helpdoc.invalid": "\"${module}\" module provided an invalid help message. Please get in touch with the developers to solve this issue.", "error.module.helpdoc.invalid": "\"${module}\" module provided invalid help information. Please contact the developers to solve this issue.",
"error.module.unbound": "\"${module}\" module isn't bound with any commands and doesn't have a description. Please get in touch with the developers to solve this issue.", "error.module.unbound": "\"${module}\" module isn't bound with any commands and doesn't have a description. Please get in touch with the developers to solve this issue.",
"error.module.unloaded": "\"${module}\" module failed to load. Please contact the developers to resolve this issue.", "error.module.unloaded": "\"${module}\" module failed to load. Please contact the developers to resolve this issue.",
"error.prompt": "An error occurred: ${error_msg}\nReport this issue: ", "error.prompt": "An error occurred: ${error_msg}\nReport this issue: ",
@ -50,7 +50,7 @@
"parser.command.running.prompt2": "The previous command is being executed.", "parser.command.running.prompt2": "The previous command is being executed.",
"parser.module.desc": "Description:\n${desc}", "parser.module.desc": "Description:\n${desc}",
"parser.module.disabled.prompt": "\"${module}\" module is not enabled. Please use \"${prefix}enable ${module}\" to enable the module.", "parser.module.disabled.prompt": "\"${module}\" module is not enabled. Please use \"${prefix}enable ${module}\" to enable the module.",
"parser.module.unloaded": "\"${module}\"hasn't been loaded yet. Use command \"${prefix}module load ${module}\" to load the module.", "parser.module.unloaded": "\"${module}\"hasn't been loaded yet. Please contact the developers to solve this issue.",
"parser.superuser.permission.denied": "You do not have permission to use this command.", "parser.superuser.permission.denied": "You do not have permission to use this command.",
"petal.message.cost": "(${count} petals used)", "petal.message.cost": "(${count} petals used)",
"petal.message.gained.limit": "However, the daily limit of petals obtained today has been reached. Please try again tomorrow.", "petal.message.gained.limit": "However, the daily limit of petals obtained today has been reached. Please try again tomorrow.",

View file

@ -50,7 +50,7 @@
"parser.command.running.prompt2": "先前的命令正在执行中。", "parser.command.running.prompt2": "先前的命令正在执行中。",
"parser.module.desc": "介绍:\n${desc}", "parser.module.desc": "介绍:\n${desc}",
"parser.module.disabled.prompt": "“${module}”模块未开启,请使用“${prefix}enable ${module}”开启本模块。", "parser.module.disabled.prompt": "“${module}”模块未开启,请使用“${prefix}enable ${module}”开启本模块。",
"parser.module.unloaded": "“${module}”模块当前未加载,使用“${prefix}module load ${module}” 命令重新加载。", "parser.module.unloaded": "“${module}”模块当前未加载,请联系开发者处理。",
"parser.superuser.permission.denied": "你没有使用该命令的权限。", "parser.superuser.permission.denied": "你没有使用该命令的权限。",
"petal.message.cost": "(使用了 ${count} 片花瓣)", "petal.message.cost": "(使用了 ${count} 片花瓣)",
"petal.message.gained.limit": "但是,本日获得花瓣已达到每日上限,请明日再试。", "petal.message.gained.limit": "但是,本日获得花瓣已达到每日上限,请明日再试。",

View file

@ -50,7 +50,7 @@
"parser.command.running.prompt2": "先前的指令正在執行中。", "parser.command.running.prompt2": "先前的指令正在執行中。",
"parser.module.desc": "描述:\n${desc}", "parser.module.desc": "描述:\n${desc}",
"parser.module.disabled.prompt": "「${module}」模組未啟用,請使用「${prefix}enable ${module}」啟用此模組。", "parser.module.disabled.prompt": "「${module}」模組未啟用,請使用「${prefix}enable ${module}」啟用此模組。",
"parser.module.unloaded": "「${module}」模組目前未載入,使用「${prefix}module load ${module}」指令重新載入。", "parser.module.unloaded": "「${module}」模組目前未載入,請聯絡開發人員處理。",
"parser.superuser.permission.denied": "你沒有使用此指令的權限。", "parser.superuser.permission.denied": "你沒有使用此指令的權限。",
"petal.message.cost": "(使用了 ${count} 片花瓣)", "petal.message.cost": "(使用了 ${count} 片花瓣)",
"petal.message.gained.limit": "但是,今日取得花瓣已達到每日上限,請明日再試。", "petal.message.gained.limit": "但是,今日取得花瓣已達到每日上限,請明日再試。",

View file

@ -65,11 +65,13 @@ async def _(msg: Bot.MessageSession):
elif video[:2] == "av": elif video[:2] == "av":
url = f"{api_url}?aid={video[2:]}" url = f"{api_url}?aid={video[2:]}"
else: else:
url = await parse_shorturl(f"https://b23.tv/{video}") ...
# url = await parse_shorturl(f"https://b23.tv/{video}")
await get_info(msg, url, get_detail=False) await get_info(msg, url, get_detail=False)
"""
async def parse_shorturl(shorturl): async def parse_shorturl(shorturl):
async with aiohttp.ClientSession() as session: async with aiohttp.ClientSession() as session:
async with session.get(shorturl, allow_redirects=True) as response: async with session.get(shorturl, allow_redirects=True) as response:
@ -78,3 +80,4 @@ async def parse_shorturl(shorturl):
video = parsed_url.path.split("/")[-2] video = parsed_url.path.split("/")[-2]
url = f"{api_url}?bvid={video}" url = f"{api_url}?bvid={video}"
return url return url
"""

View file

@ -17,8 +17,8 @@
"core.help.module.enable": "Enable single/multiple module(s).", "core.help.module.enable": "Enable single/multiple module(s).",
"core.help.module.enable_all": "Enable all modules.", "core.help.module.enable_all": "Enable all modules.",
"core.help.module.help": "View help list.", "core.help.module.help": "View help list.",
"core.help.module.help.legacy": "View help list. (Legacy)",
"core.help.module.help.detail": "View details of a module.", "core.help.module.help.detail": "View details of a module.",
"core.help.module.help.legacy": "View help list. (Legacy)",
"core.help.module.list": "View all available modules.", "core.help.module.list": "View all available modules.",
"core.help.mute": "Make the robot stop sending message.", "core.help.mute": "Make the robot stop sending message.",
"core.help.option.module.g": "Perform global operations of the channels.", "core.help.option.module.g": "Perform global operations of the channels.",
@ -39,6 +39,7 @@
"core.message.abuse.unban.success": "Successfully unbanned ${user}.", "core.message.abuse.unban.success": "Successfully unbanned ${user}.",
"core.message.abuse.untempban.success": "Successfully removed temporary limit on ${user}.", "core.message.abuse.untempban.success": "Successfully removed temporary limit on ${user}.",
"core.message.abuse.warn.success": "Successfully warned ${user} ${counts} time(s). This user has been warned ${warn_counts} time(s).", "core.message.abuse.warn.success": "Successfully warned ${user} ${counts} time(s). This user has been warned ${warn_counts} time(s).",
"core.message.admin.add.success": "Success: Has set ${user} to robot administrator.",
"core.message.admin.already": "This member is already a robot administrator.", "core.message.admin.already": "This member is already a robot administrator.",
"core.message.admin.ban.already": "This member has been banned from using robot.", "core.message.admin.ban.already": "This member has been banned from using robot.",
"core.message.admin.ban.not_yet": "This member has not been banned from using robot.", "core.message.admin.ban.not_yet": "This member has not been banned from using robot.",
@ -46,6 +47,7 @@
"core.message.admin.invalid": "Invalid ID format. The format should be \"${target}|<User ID>\".", "core.message.admin.invalid": "Invalid ID format. The format should be \"${target}|<User ID>\".",
"core.message.admin.list": "Robot administrators manually set in the current group: ", "core.message.admin.list": "Robot administrators manually set in the current group: ",
"core.message.admin.list.none": "There are currently no manual robot administrators.", "core.message.admin.list.none": "There are currently no manual robot administrators.",
"core.message.admin.remove.success": "Success: Removed ${user} from robot administrator.",
"core.message.alias.add.already_in": "\"${arg1}\" alias already exists in custom alias list.", "core.message.alias.add.already_in": "\"${arg1}\" alias already exists in custom alias list.",
"core.message.alias.add.invalid_prefix": "The command corresponding to the added alias must start with a command prefix, please check.", "core.message.alias.add.invalid_prefix": "The command corresponding to the added alias must start with a command prefix, please check.",
"core.message.alias.add.success": "Custom command alias added: ${arg1} -> ${arg2}", "core.message.alias.add.success": "Custom command alias added: ${arg1} -> ${arg2}",
@ -56,17 +58,22 @@
"core.message.alias.remove.not_found": "\"${arg1}\" alias does not exist in custom alias list.", "core.message.alias.remove.not_found": "\"${arg1}\" alias does not exist in custom alias list.",
"core.message.alias.remove.success": "Removed custom command alias: ${arg1}", "core.message.alias.remove.success": "Removed custom command alias: ${arg1}",
"core.message.alias.reset.success": "The custom command alias has been reset.", "core.message.alias.reset.success": "The custom command alias has been reset.",
"core.message.update.failed": "Failed to fetch update from GitHub. Please try again later.", "core.message.analytics.counts": "Number of times the commands have executed (from ${first_record}): ${counts}",
"core.message.analytics.days": "Last 30 days for command \"${module}\" calls (from ${first_record}): ",
"core.message.analytics.days.total": "Last 30 days for all command calls (from ${first_record}): ",
"core.message.analytics.disabled": "Analytics command is not enabled.",
"core.message.analytics.year": "Last year for command \"${module}\" calls (from ${first_record}): ",
"core.message.analytics.year.total": "Last year for all command calls (from ${first_record}): ",
"core.message.config.write.failed": "Failed. Try to use escaped quotes or check the input.",
"core.message.forward_msg.disable": "Forward message disabled.", "core.message.forward_msg.disable": "Forward message disabled.",
"core.message.forward_msg.enable": "Forward message enabled.",
"core.message.forward_msg.disabled": "Forward message is disabled.\n", "core.message.forward_msg.disabled": "Forward message is disabled.\n",
"core.message.forward_msg.enable": "Forward message enabled.",
"core.message.leave.confirm": "Are you sure? This action is irreversible.", "core.message.leave.confirm": "Are you sure? This action is irreversible.",
"core.message.leave.success": "Goodbye.", "core.message.leave.success": "Goodbye.",
"core.message.locale": "Current language: ",
"core.message.locale.reload.failed": "Failed to reload the following string: ${detail}.", "core.message.locale.reload.failed": "Failed to reload the following string: ${detail}.",
"core.message.locale.set.invalid": "Invalid language code. Supported language code(s): ${langlist}", "core.message.locale.set.invalid": "Invalid language code. Supported language code(s): ${langlist}",
"core.message.locale": "Current language: ", "core.message.locale.set.prompt": "Use \"${prefix}locale <language code>\" to set the language.\nSupported language code(s): ${langlist}\nGo to Crowdin and help with translation:\nhttps://www.crowdin.com/project/akari-bot",
"core.message.locale.contribution": "Current language is being translated. Go to Crowdin and help with translation:\nhttps://www.crowdin.com/project/akari-bot",
"core.message.locale.set.prompt": "Use \"${prefix}locale <language code>\" to set the language.\nSupported language code(s): ${langlist}",
"core.message.module.disable.already": "Failed: Module \"${module}\" is disabled.", "core.message.module.disable.already": "Failed: Module \"${module}\" is disabled.",
"core.message.module.disable.base": "Failed: \"${module}\" is a base module, thus cannot be disabled.", "core.message.module.disable.base": "Failed: \"${module}\" is a base module, thus cannot be disabled.",
"core.message.module.disable.not_found": "Failed: Module \"${module}\" does not exist.", "core.message.module.disable.not_found": "Failed: Module \"${module}\" does not exist.",
@ -89,7 +96,7 @@
"core.message.module.help.regex.detail": "(${msg})", "core.message.module.help.regex.detail": "(${msg})",
"core.message.module.help.regex.no_information": "No description", "core.message.module.help.regex.no_information": "No description",
"core.message.module.help.support_regex": "This module supports regular expressions, the message will match with the following: ", "core.message.module.help.support_regex": "This module supports regular expressions, the message will match with the following: ",
"core.message.module.help.table.header.alias": "Command Aliases", "core.message.module.help.table.header.alias": "Command Alias",
"core.message.module.help.table.header.base": "Base Module List", "core.message.module.help.table.header.base": "Base Module List",
"core.message.module.help.table.header.external": "Extended Module List", "core.message.module.help.table.header.external": "Extended Module List",
"core.message.module.help.table.header.help": "Help", "core.message.module.help.table.header.help": "Help",
@ -106,17 +113,17 @@
"core.message.module.reload.success.base": "Successfully reloaded the base modules.", "core.message.module.reload.success.base": "Successfully reloaded the base modules.",
"core.message.module.reload.unbound": "Failed: Module \"${module}\" does not bound.", "core.message.module.reload.unbound": "Failed: Module \"${module}\" does not bound.",
"core.message.module.reload.with": "And ${reloadCnt} files under these module(s).", "core.message.module.reload.with": "And ${reloadCnt} files under these module(s).",
"core.message.module.unload.base": "Failed: \"${module}\" is a base module, thus cannot be unloaded.",
"core.message.module.unload.confirm": "This operation will unload all modules related to it and disable them completely after the next restart (not including cross-reference). Continue?", "core.message.module.unload.confirm": "This operation will unload all modules related to it and disable them completely after the next restart (not including cross-reference). Continue?",
"core.message.module.unload.error": "An error occurred: The module does not exist.", "core.message.module.unload.error": "An error occurred: The module does not exist.",
"core.message.module.unload.base": "Failed: \"${module}\" is a base module, thus cannot be unloaded.",
"core.message.module.unload.success": "Successfully unloaded module: ${module}", "core.message.module.unload.success": "Successfully unloaded module: ${module}",
"core.message.module.unload.unavailable.confirm": "This module cannot be loaded due to an error. This operation will disable this module completely after the next restart. Continue?", "core.message.module.unload.unavailable.confirm": "This module cannot be loaded due to an error. This operation will disable this module completely after the next restart. Continue?",
"core.message.module.unsupported_language": "Note: Module\"${module}\" does not support the current language. This module may not display content under the current language correctly.", "core.message.module.unsupported_language": "Note: Module\"${module}\" does not support the current language. This module may not display content under the current language correctly.",
"core.message.mute.disable": "Successfully unmuted.", "core.message.mute.disable": "Successfully unmuted.",
"core.message.mute.enable": "Successfully muted.", "core.message.mute.enable": "Successfully muted.",
"core.message.petal": "${petal} petal(s) remain in the group ${group}.", "core.message.petal": "${petal} petal(s) remain in the group ${group}.",
"core.message.petal.modify.self": " Successfully modified ${add_petal} petals for this group, now this group has ${petal} petals.",
"core.message.petal.modify": " Successfully modified ${add_petal} petals for target group ${group}, now ${group} has ${petal} petals.", "core.message.petal.modify": " Successfully modified ${add_petal} petals for target group ${group}, now ${group} has ${petal} petals.",
"core.message.petal.modify.self": " Successfully modified ${add_petal} petals for this group, now this group has ${petal} petals.",
"core.message.petal.no_petals": "There are not enough petals in the group. If you need to add petals, please go here to send your application:", "core.message.petal.no_petals": "There are not enough petals in the group. If you need to add petals, please go here to send your application:",
"core.message.petal.self": "${petal} petal(s) remain in this group.", "core.message.petal.self": "${petal} petal(s) remain in this group.",
"core.message.ping.detail": "System startup time: ${system_boot_time}\nRobot is running: ${bot_running_time}\nPython version: ${python_version}\nProcessor model: ${cpu_brand}\nCurrent processor usage: ${cpu_usage}%\nPhysical memory: ${ram}M Utilized: ${ram_percent}%\nSwap memory: ${swap}M Utilized: ${swap_percent}%\nDisk capacity: ${disk_space}G/${disk_space_total}G", "core.message.ping.detail": "System startup time: ${system_boot_time}\nRobot is running: ${bot_running_time}\nPython version: ${python_version}\nProcessor model: ${cpu_brand}\nCurrent processor usage: ${cpu_usage}%\nPhysical memory: ${ram}M Utilized: ${ram_percent}%\nSwap memory: ${swap}M Utilized: ${swap_percent}%\nDisk capacity: ${disk_space}G/${disk_space_total}G",
@ -128,10 +135,11 @@
"core.message.prefix.remove.not_found": "This command prefix does not exist in the custom prefix list.", "core.message.prefix.remove.not_found": "This command prefix does not exist in the custom prefix list.",
"core.message.prefix.remove.success": "Custom command prefix removed: ", "core.message.prefix.remove.success": "Custom command prefix removed: ",
"core.message.prefix.reset": "The custom command prefix has been reset.", "core.message.prefix.reset": "The custom command prefix has been reset.",
"core.message.restart.prompt": "As the robot is rebooting, you have been forced to cancel this execution command.\nPlease re-execute the command later.", "core.message.raise": "Test exception.",
"core.message.restart.prompt": "Since the robot is restarting, your command execution have been forcibly cancelled.\nPlease re-execute the command later.",
"core.message.restart.restarting": "Restarting...", "core.message.restart.restarting": "Restarting...",
"core.message.restart.timeout": "Waiting timeout, force restarting...", "core.message.restart.timeout": "Waiting timeout, force restarting...",
"core.message.restart.wait": "There are ${count} command(s) being executed, the bot will reboot after the execution.", "core.message.restart.wait": "There are ${count} command(s) being executed, the bot will restart after the execution.",
"core.message.resume.clear": "All messages cleared.", "core.message.resume.clear": "All messages cleared.",
"core.message.resume.done": "Resume complete.", "core.message.resume.done": "Resume complete.",
"core.message.resume.nothing": "No messages to be resumed.", "core.message.resume.nothing": "No messages to be resumed.",
@ -146,19 +154,11 @@
"core.message.toggle.check.enable": "Check prompt enabled.", "core.message.toggle.check.enable": "Check prompt enabled.",
"core.message.toggle.typing.disable": "Input prompt disabled.", "core.message.toggle.typing.disable": "Input prompt disabled.",
"core.message.toggle.typing.enable": "Input prompt enabled.", "core.message.toggle.typing.enable": "Input prompt enabled.",
"core.message.update.failed": "Failed to fetch update from GitHub. Please try again later.",
"core.message.version": "Current robot version: ${commit}", "core.message.version": "Current robot version: ${commit}",
"core.message.version.unknown": "Unable to get version. This instance may not be deployed using Git.", "core.message.version.unknown": "Unable to get version. This instance may not be deployed using Git.",
"core.message.whoami": "Your ID: ${senderid}\nThe ID of this conversation: ${targetid}", "core.message.whoami": "Your ID: ${senderid}\nConversation ID: ${targetid}",
"core.message.whoami.admin": "(You have admin permission for this conversation)", "core.message.whoami.admin": "(You have admin permission for this conversation)",
"core.message.whoami.botadmin": "(You have robot admin permission for this conversation)", "core.message.whoami.botadmin": "(You have robot admin permission for this conversation)",
"core.message.whoami.superuser": "(You have superuser permission)", "core.message.whoami.superuser": "(You have superuser permission)"
"core.message.analytics.counts": "Number of times the commands have executed (from ${first_record}): ${counts}",
"core.message.analytics.days": "Last 30 days for command \"${module}\" calls (from ${first_record}): ",
"core.message.analytics.days.total": "Last 30 days for all command calls (from ${first_record}): ",
"core.message.analytics.disabled": "Analytics command is not enabled.",
"core.message.analytics.year": "Last year for command \"${module}\" calls (from ${first_record}): ",
"core.message.analytics.year.total": "Last year for all command calls (from ${first_record}): ",
"core.message.raise": "Test exception.",
"core.message.admin.add.success": "Success: Has set ${user} to robot administrator.",
"core.message.admin.remove.success": "Success: Removed ${user} from robot administrator."
} }

View file

@ -71,10 +71,9 @@
"core.message.leave.confirm": "你确定吗?此操作不可逆。", "core.message.leave.confirm": "你确定吗?此操作不可逆。",
"core.message.leave.success": "已执行,再见。", "core.message.leave.success": "已执行,再见。",
"core.message.locale": "当前使用的语言:", "core.message.locale": "当前使用的语言:",
"core.message.locale.contribution": "当前使用的语言正在翻译中,欢迎前往 Crowdin 协助翻译:\nhttps://www.crowdin.com/project/akari-bot",
"core.message.locale.reload.failed": "以下字符串重载失败:${detail}。", "core.message.locale.reload.failed": "以下字符串重载失败:${detail}。",
"core.message.locale.set.invalid": "语言代码无效,支持的语言代码:${langlist}", "core.message.locale.set.invalid": "语言代码无效,支持的语言代码:${langlist}",
"core.message.locale.set.prompt": "可使用“${prefix}locale <语言代码>”设置语言。\n支持的语言代码${langlist}", "core.message.locale.set.prompt": "可使用“${prefix}locale <语言代码>”设置语言。\n支持的语言代码${langlist}\n欢迎前往 Crowdin 协助翻译:\nhttps://www.crowdin.com/project/akari-bot",
"core.message.module.disable.already": "失败:“${module}”模块已关闭。", "core.message.module.disable.already": "失败:“${module}”模块已关闭。",
"core.message.module.disable.base": "失败:“${module}”为基础模块,无法关闭。", "core.message.module.disable.base": "失败:“${module}”为基础模块,无法关闭。",
"core.message.module.disable.not_found": "失败:“${module}”模块不存在。", "core.message.module.disable.not_found": "失败:“${module}”模块不存在。",

View file

@ -17,8 +17,8 @@
"core.help.module.enable": "啟用一個/多個模組。", "core.help.module.enable": "啟用一個/多個模組。",
"core.help.module.enable_all": "啟用所有模組。", "core.help.module.enable_all": "啟用所有模組。",
"core.help.module.help": "檢視說明列表。", "core.help.module.help": "檢視說明列表。",
"core.help.module.help.legacy": "檢視說明列表。(舊版)",
"core.help.module.help.detail": "檢視一個模組的詳細資訊。", "core.help.module.help.detail": "檢視一個模組的詳細資訊。",
"core.help.module.help.legacy": "檢視說明列表。(舊版)",
"core.help.module.list": "檢視所有可用模組。", "core.help.module.list": "檢視所有可用模組。",
"core.help.mute": "使機器人停止發言。", "core.help.mute": "使機器人停止發言。",
"core.help.option.module.g": "對頻道進行全域操作。", "core.help.option.module.g": "對頻道進行全域操作。",
@ -39,6 +39,7 @@
"core.message.abuse.unban.success": "成功解除 ${user} 的封鎖。", "core.message.abuse.unban.success": "成功解除 ${user} 的封鎖。",
"core.message.abuse.untempban.success": "成功移除 ${user} 的暫時限制。", "core.message.abuse.untempban.success": "成功移除 ${user} 的暫時限制。",
"core.message.abuse.warn.success": "成功警告 ${user} ${counts} 次。此使用者已被警告 ${warn_counts} 次。", "core.message.abuse.warn.success": "成功警告 ${user} ${counts} 次。此使用者已被警告 ${warn_counts} 次。",
"core.message.admin.add.success": "成功:已將 ${user} 設定為機器人管理員。",
"core.message.admin.already": "此成員已是機器人管理員。", "core.message.admin.already": "此成員已是機器人管理員。",
"core.message.admin.ban.already": "此成員已被禁止使用機器人。", "core.message.admin.ban.already": "此成員已被禁止使用機器人。",
"core.message.admin.ban.not_yet": "此成員沒有被禁止使用機器人。", "core.message.admin.ban.not_yet": "此成員沒有被禁止使用機器人。",
@ -46,6 +47,7 @@
"core.message.admin.invalid": "ID 格式錯誤,格式應為「${target}|<使用者 ID>」。", "core.message.admin.invalid": "ID 格式錯誤,格式應為「${target}|<使用者 ID>」。",
"core.message.admin.list": "目前在群組內手動設定的機器人管理員:\n", "core.message.admin.list": "目前在群組內手動設定的機器人管理員:\n",
"core.message.admin.list.none": "目前沒有手動設定的機器人管理員。", "core.message.admin.list.none": "目前沒有手動設定的機器人管理員。",
"core.message.admin.remove.success": "成功:已將 ${user} 移出機器人管理員。",
"core.message.alias.add.already_in": "「${arg1}」別名已存在於自訂別名列表。", "core.message.alias.add.already_in": "「${arg1}」別名已存在於自訂別名列表。",
"core.message.alias.add.invalid_prefix": "新增的別名對應的指令必須以指令前綴開頭,請檢查。", "core.message.alias.add.invalid_prefix": "新增的別名對應的指令必須以指令前綴開頭,請檢查。",
"core.message.alias.add.success": "已新增自訂指令別名:${arg1} -> ${arg2}", "core.message.alias.add.success": "已新增自訂指令別名:${arg1} -> ${arg2}",
@ -56,17 +58,22 @@
"core.message.alias.remove.not_found": "「${arg1}」別名不存在於自訂別名列表。", "core.message.alias.remove.not_found": "「${arg1}」別名不存在於自訂別名列表。",
"core.message.alias.remove.success": "已移除自訂指令別名:${arg1}", "core.message.alias.remove.success": "已移除自訂指令別名:${arg1}",
"core.message.alias.reset.success": "已重設自訂指令別名列表。", "core.message.alias.reset.success": "已重設自訂指令別名列表。",
"core.message.update.failed": "嘗試從 GitHub 取得更新失敗,請稍後重試。", "core.message.analytics.counts": "機器人已執行指令次數(自 ${first_record} 開始統計):${counts}\n今日已執行指令次數${counts_today}",
"core.message.analytics.days": "最近 30 日的「${module}」指令呼叫次數統計(自 ${first_record} 開始統計):",
"core.message.analytics.days.total": "最近 30 日的所有指令呼叫次數統計(自 ${first_record} 開始統計):",
"core.message.analytics.disabled": "機器人未啟用指令統計功能。",
"core.message.analytics.year": "最近一年的「${module}」指令呼叫次數统计(自 ${first_record} 开始统计):",
"core.message.analytics.year.total": "最近一年的所有指令呼叫次數統計(自 ${first_record} 開始統計):",
"core.message.config.write.failed": "失敗,請嘗試使用跳脫引號或校對輸入。",
"core.message.forward_msg.disable": "已停用轉發訊息。", "core.message.forward_msg.disable": "已停用轉發訊息。",
"core.message.forward_msg.enable": "已啟用轉發訊息。",
"core.message.forward_msg.disabled": "轉發訊息已停用。", "core.message.forward_msg.disabled": "轉發訊息已停用。",
"core.message.forward_msg.enable": "已啟用轉發訊息。",
"core.message.leave.confirm": "你確定嗎?此行為不可逆。", "core.message.leave.confirm": "你確定嗎?此行為不可逆。",
"core.message.leave.success": "已執行,再見。", "core.message.leave.success": "已執行,再見。",
"core.message.locale": "目前使用的語言:",
"core.message.locale.reload.failed": "以下字串重新加載失敗:${detail}。", "core.message.locale.reload.failed": "以下字串重新加載失敗:${detail}。",
"core.message.locale.set.invalid": "無效的語言代碼,已支援的語言代碼:${langlist}", "core.message.locale.set.invalid": "無效的語言代碼,已支援的語言代碼:${langlist}",
"core.message.locale": "目前使用的語言:", "core.message.locale.set.prompt": "可使用「${prefix}locale <語言代碼>」設定語言。\n已支援的語言代碼${langlist}\n歡迎前往 Crowdin 協助翻譯:\nhttps://www.crowdin.com/project/akari-bot",
"core.message.locale.contribution": "目前使用的語言正在翻譯中,歡迎前往 Crowdin 協助翻譯:\nhttps://www.crowdin.com/project/akari-bot",
"core.message.locale.set.prompt": "可使用「${prefix}locale <語言代碼>」設定語言。\n已支援的語言代碼${langlist}",
"core.message.module.disable.already": "失敗:「${module}」模組已停用。", "core.message.module.disable.already": "失敗:「${module}」模組已停用。",
"core.message.module.disable.base": "失敗:「${module}」為基礎模組,無法停用。", "core.message.module.disable.base": "失敗:「${module}」為基礎模組,無法停用。",
"core.message.module.disable.not_found": "失敗:「${module}」模組不存在。", "core.message.module.disable.not_found": "失敗:「${module}」模組不存在。",
@ -106,17 +113,17 @@
"core.message.module.reload.success.base": "成功重新載入基礎模組。", "core.message.module.reload.success.base": "成功重新載入基礎模組。",
"core.message.module.reload.unbound": "失敗:「${module}」模組尚未綁定。", "core.message.module.reload.unbound": "失敗:「${module}」模組尚未綁定。",
"core.message.module.reload.with": "以及此模組下的 ${reloadCnt} 個檔案。", "core.message.module.reload.with": "以及此模組下的 ${reloadCnt} 個檔案。",
"core.message.module.unload.base": "失敗:「${module}」為基礎模組,無法移除。",
"core.message.module.unload.confirm": "此動作將會移除與其相關的所有模組,並在下一次重新啟動後完全停用(不包含互相參照的模組),是否繼續?", "core.message.module.unload.confirm": "此動作將會移除與其相關的所有模組,並在下一次重新啟動後完全停用(不包含互相參照的模組),是否繼續?",
"core.message.module.unload.error": "發生錯誤:此模組不存在。", "core.message.module.unload.error": "發生錯誤:此模組不存在。",
"core.message.module.unload.base": "失敗:「${module}」為基礎模組,無法移除。",
"core.message.module.unload.success": "成功移除模組:${module}", "core.message.module.unload.success": "成功移除模組:${module}",
"core.message.module.unload.unavailable.confirm": "此模組已由於發生錯誤而無法載入,此動作將會在下一次重新啟動後完全停用此模組,是否繼續?", "core.message.module.unload.unavailable.confirm": "此模組已由於發生錯誤而無法載入,此動作將會在下一次重新啟動後完全停用此模組,是否繼續?",
"core.message.module.unsupported_language": "提示:「${module}」模組不支援目前語言,此模組可能不會正確展示目前語言下的內容。", "core.message.module.unsupported_language": "提示:「${module}」模組不支援目前語言,此模組可能不會正確展示目前語言下的內容。",
"core.message.mute.disable": "成功取消靜音。", "core.message.mute.disable": "成功取消靜音。",
"core.message.mute.enable": "成功靜音。", "core.message.mute.enable": "成功靜音。",
"core.message.petal": "目前群組 ${group} 的花瓣數為:${petal}。", "core.message.petal": "目前群組 ${group} 的花瓣數為:${petal}。",
"core.message.petal.modify.self": "已為本群組修改了 ${add_petal} 花瓣,目前花瓣數為:${petal}。",
"core.message.petal.modify": "已為群組 ${group} 修改了 ${add_petal} 花瓣,目前花瓣數為:${petal}。", "core.message.petal.modify": "已為群組 ${group} 修改了 ${add_petal} 花瓣,目前花瓣數為:${petal}。",
"core.message.petal.modify.self": "已為本群組修改了 ${add_petal} 花瓣,目前花瓣數為:${petal}。",
"core.message.petal.no_petals": "群組內的花瓣不足,若需要增加花瓣,請前往此處申請:", "core.message.petal.no_petals": "群組內的花瓣不足,若需要增加花瓣,請前往此處申請:",
"core.message.petal.self": "目前本群組的花瓣數為:${petal}。", "core.message.petal.self": "目前本群組的花瓣數為:${petal}。",
"core.message.ping.detail": "系統啟動時間:${system_boot_time}\n機器人已運行${bot_running_time}\nPython 版本:${python_version}\n處理器型號${cpu_brand}\n目前處理器使用率${cpu_usage}%\n物理記憶體${ram}M 使用率:${ram_percent}%\nSwap 記憶體:${swap}M 使用率:${swap_percent}%\n磁碟容量${disk_space}G/${disk_space_total}G", "core.message.ping.detail": "系統啟動時間:${system_boot_time}\n機器人已運行${bot_running_time}\nPython 版本:${python_version}\n處理器型號${cpu_brand}\n目前處理器使用率${cpu_usage}%\n物理記憶體${ram}M 使用率:${ram_percent}%\nSwap 記憶體:${swap}M 使用率:${swap_percent}%\n磁碟容量${disk_space}G/${disk_space_total}G",
@ -128,6 +135,7 @@
"core.message.prefix.remove.not_found": "此指令前綴不存在於自訂前綴列表。", "core.message.prefix.remove.not_found": "此指令前綴不存在於自訂前綴列表。",
"core.message.prefix.remove.success": "已移除自訂指令前綴:", "core.message.prefix.remove.success": "已移除自訂指令前綴:",
"core.message.prefix.reset": "已重設自訂指令前綴列表。", "core.message.prefix.reset": "已重設自訂指令前綴列表。",
"core.message.raise": "例外測試。",
"core.message.restart.prompt": "由於機器人正在重新啟動,您此次執行指令的後續操作已被取消。\n請稍後重新執行指令對此帶來的不便我們深感抱歉。", "core.message.restart.prompt": "由於機器人正在重新啟動,您此次執行指令的後續操作已被取消。\n請稍後重新執行指令對此帶來的不便我們深感抱歉。",
"core.message.restart.restarting": "重新啟動中……", "core.message.restart.restarting": "重新啟動中……",
"core.message.restart.timeout": "等待逾時,強制重新啟動中……", "core.message.restart.timeout": "等待逾時,強制重新啟動中……",
@ -146,19 +154,11 @@
"core.message.toggle.check.enable": "已啟用指令錯誤檢查提醒。", "core.message.toggle.check.enable": "已啟用指令錯誤檢查提醒。",
"core.message.toggle.typing.disable": "已停用輸入提醒。", "core.message.toggle.typing.disable": "已停用輸入提醒。",
"core.message.toggle.typing.enable": "已啟用輸入提醒。", "core.message.toggle.typing.enable": "已啟用輸入提醒。",
"core.message.update.failed": "嘗試從 GitHub 取得更新失敗,請稍後重試。",
"core.message.version": "目前機器人版本號:${commit}", "core.message.version": "目前機器人版本號:${commit}",
"core.message.version.unknown": "無法取得版本號。此實例可能沒有使用 Git 進行部署。", "core.message.version.unknown": "無法取得版本號。此實例可能沒有使用 Git 進行部署。",
"core.message.whoami": "你的 ID 是:${senderid}\n此對話的 ID 是:${targetid}", "core.message.whoami": "你的 ID 是:${senderid}\n此對話的 ID 是:${targetid}",
"core.message.whoami.admin": "(你擁有此對話的管理員權限)", "core.message.whoami.admin": "(你擁有此對話的管理員權限)",
"core.message.whoami.botadmin": "(你擁有此對話的機器人管理員權限)", "core.message.whoami.botadmin": "(你擁有此對話的機器人管理員權限)",
"core.message.whoami.superuser": "(你擁有此機器人的超級使用者權限)", "core.message.whoami.superuser": "(你擁有此機器人的超級使用者權限)"
"core.message.analytics.counts": "機器人已執行指令次數(自 ${first_record} 開始統計):${counts}\n今日已執行指令次數${counts_today}",
"core.message.analytics.days": "最近 30 日的「${module}」指令呼叫次數統計(自 ${first_record} 開始統計):",
"core.message.analytics.days.total": "最近 30 日的所有指令呼叫次數統計(自 ${first_record} 開始統計):",
"core.message.analytics.disabled": "機器人未啟用指令統計功能。",
"core.message.analytics.year": "最近一年的「${module}」指令呼叫次數统计(自 ${first_record} 开始统计):",
"core.message.analytics.year.total": "最近一年的所有指令呼叫次數統計(自 ${first_record} 開始統計):",
"core.message.raise": "例外測試。",
"core.message.admin.add.success": "成功:已將 ${user} 設定為機器人管理員。",
"core.message.admin.remove.success": "成功:已將 ${user} 移出機器人管理員。"
} }

View file

@ -170,15 +170,15 @@ async def config_modules(msg: Bot.MessageSession):
if base_mode and reload_count: if base_mode and reload_count:
return msg.locale.t("core.message.module.reload.success.base") return msg.locale.t("core.message.module.reload.success.base")
elif reload_count > 1: elif reload_count > 1:
return (f"{msg.locale.t('core.message.module.reload.success', module=module)}" + return msg.locale.t('core.message.module.reload.success', module=module) + \
'\n' if len(extra_modules) != 0 else '') + \ ('\n' if len(extra_modules) != 0 else '') + \
'\n'.join(extra_modules) + \ '\n'.join(extra_modules) + \
f"\n{msg.locale.t('core.message.module.reload.with', reloadCnt=reload_count - 1)}" '\n' + msg.locale.t('core.message.module.reload.with', reloadCnt=reload_count - 1)
elif reload_count == 1: elif reload_count == 1:
return (f"{msg.locale.t('core.message.module.reload.success', module=module)}" + return msg.locale.t('core.message.module.reload.success', module=module) + \
'\n' if len(extra_modules) != 0 else '' + ('\n' if len(extra_modules) != 0 else '') + \
'\n'.join(extra_modules) + '\n'.join(extra_modules) + \
f"\n{msg.locale.t('core.message.module.reload.no_more')}") '\n' + msg.locale.t('core.message.module.reload.no_more')
else: else:
return msg.locale.t("core.message.module.reload.failed") return msg.locale.t("core.message.module.reload.failed")

View file

@ -127,8 +127,6 @@ async def config_ban(msg: Bot.MessageSession):
locale = module('locale', base=True, developers=['Dianliang233', 'Light-Beacon']) locale = module('locale', base=True, developers=['Dianliang233', 'Light-Beacon'])
completed_locales = ["zh_cn", "zh_tw"]
@locale.handle('{{core.help.locale}}') @locale.handle('{{core.help.locale}}')
async def _(msg: Bot.MessageSession): async def _(msg: Bot.MessageSession):
avaliable_lang = msg.locale.t("message.delimiter").join(get_available_locales()) avaliable_lang = msg.locale.t("message.delimiter").join(get_available_locales())
@ -141,8 +139,6 @@ async def config_gu(msg: Bot.MessageSession):
lang = msg.parsed_msg['<lang>'] lang = msg.parsed_msg['<lang>']
if lang in get_available_locales() and BotDBUtil.TargetInfo(msg.target.target_id).edit('locale', lang): if lang in get_available_locales() and BotDBUtil.TargetInfo(msg.target.target_id).edit('locale', lang):
await msg.send_message(Locale(lang).t('success')) await msg.send_message(Locale(lang).t('success'))
if lang not in completed_locales:
await msg.finish(Locale(lang).t('core.message.locale.contribution'))
else: else:
avaliable_lang = msg.locale.t("message.delimiter").join(get_available_locales()) avaliable_lang = msg.locale.t("message.delimiter").join(get_available_locales())
await msg.finish(msg.locale.t("core.message.locale.set.invalid", langlist=avaliable_lang)) await msg.finish(msg.locale.t("core.message.locale.set.invalid", langlist=avaliable_lang))

View file

@ -3,7 +3,8 @@
"maimai.help.b50": "查询 Maimai 用户的 B50 信息。", "maimai.help.b50": "查询 Maimai 用户的 B50 信息。",
"maimai.help.base": "根据定数或定数范围搜索歌曲。", "maimai.help.base": "根据定数或定数范围搜索歌曲。",
"maimai.help.desc": "查询 Maimai 相关内容。", "maimai.help.desc": "查询 Maimai 相关内容。",
"maimai.help.info": "查询歌曲的相关谱面成绩。", "maimai.help.id": "根据 ID 查询歌曲或谱面信息。",
"maimai.help.info": "查询歌曲的相关谱面成绩ID 需要加入前缀“id”空格用“_”替代。",
"maimai.help.level": "根据等级搜索歌曲。", "maimai.help.level": "根据等级搜索歌曲。",
"maimai.help.maimai_regex.alias": "<ID> 有什么别名 查询歌曲的别名。", "maimai.help.maimai_regex.alias": "<ID> 有什么别名 查询歌曲的别名。",
"maimai.help.maimai_regex.desc": "更方便地使用 Maimai 相关命令。", "maimai.help.maimai_regex.desc": "更方便地使用 Maimai 相关命令。",

View file

@ -4,16 +4,16 @@
"wiki.help": "Query a wiki page.", "wiki.help": "Query a wiki page.",
"wiki.help.ab.desc": "Get recent abuse logs for the default wiki.", "wiki.help.ab.desc": "Get recent abuse logs for the default wiki.",
"wiki.help.fandom": "Toggles whether to use Fandom global Interwiki queries.", "wiki.help.fandom": "Toggles whether to use Fandom global Interwiki queries.",
"wiki.help.headers.show": "Lists the currently set request headers.",
"wiki.help.headers.remove": "Remove custom request headers.", "wiki.help.headers.remove": "Remove custom request headers.",
"wiki.help.headers.reset": "Reset custom request headers.", "wiki.help.headers.reset": "Reset custom request headers.",
"wiki.help.headers.add": "Add custom request headers.", "wiki.help.headers.add": "Add custom request headers.",
"wiki.help.headers.show": "Lists the currently set request headers.",
"wiki.help.id": "Query a Wiki page based on page ID.", "wiki.help.id": "Query a Wiki page based on page ID.",
"wiki.help.iw.add": "Add custom Interwiki.",
"wiki.help.iw.get": "Get the API address corresponding to the set Interwiki.", "wiki.help.iw.get": "Get the API address corresponding to the set Interwiki.",
"wiki.help.iw.list": "Lists the currently configured Interwiki.", "wiki.help.iw.list": "Lists the currently configured Interwiki.",
"wiki.help.iw.list.legacy": "Lists the currently configured Interwiki. (Legacy)", "wiki.help.iw.list.legacy": "Lists the currently configured Interwiki. (Legacy)",
"wiki.help.iw.remove": "Remove custom Interwiki.", "wiki.help.iw.remove": "Remove custom Interwiki.",
"wiki.help.iw.add": "Add custom Interwiki.",
"wiki.help.newbie.desc": "Get recent newbie logs for the default wiki.", "wiki.help.newbie.desc": "Get recent newbie logs for the default wiki.",
"wiki.help.option.l": "Find the corresponding language version of this page, and return the current language if no result.", "wiki.help.option.l": "Find the corresponding language version of this page, and return the current language if no result.",
"wiki.help.prefix.reset": "Reset custom command prefix.", "wiki.help.prefix.reset": "Reset custom command prefix.",
@ -45,13 +45,13 @@
"wiki.message.id.error": "An error occurred: Page ID must be numeric.", "wiki.message.id.error": "An error occurred: Page ID must be numeric.",
"wiki.message.id.not_found": "Page with page ID ${id} not found.", "wiki.message.id.not_found": "Page with page ID ${id} not found.",
"wiki.message.invalid_namespace": "There is no namespace named ${namespace} on this wiki, please check your input.", "wiki.message.invalid_namespace": "There is no namespace named ${namespace} on this wiki, please check your input.",
"wiki.message.iw.add.success": "Custom Interwiki added:\n ${iw} -> ${name}",
"wiki.message.iw.get.not_found": "Interwiki not found: ${iw}", "wiki.message.iw.get.not_found": "Interwiki not found: ${iw}",
"wiki.message.iw.list": "Use \"${prefix}wiki iw get <Interwiki>\" to get the corresponding link to Interwiki.", "wiki.message.iw.list": "Use \"${prefix}wiki iw get <Interwiki>\" to get the corresponding link to Interwiki.",
"wiki.message.iw.list.legacy": "The following Interwiki(s) are currently set up:\n", "wiki.message.iw.list.legacy": "The following Interwiki(s) are currently set up:\n",
"wiki.message.iw.list.prompt": "Here are the custom Interwiki(s) set up for bot. To view the Interwiki for the initial wiki, see: ${url}", "wiki.message.iw.list.prompt": "Here are the custom Interwiki(s) set up for bot. To view the Interwiki for the initial wiki, see: ${url}",
"wiki.message.iw.none": "There is currently no Interwiki. Can be added using \"${prefix}wiki iw add\".", "wiki.message.iw.none": "There is currently no Interwiki. Can be added using \"${prefix}wiki iw add\".",
"wiki.message.iw.remove.success": "Custom Interwiki removed: ${iw}", "wiki.message.iw.remove.success": "Custom Interwiki removed: ${iw}",
"wiki.message.iw.add.success": "Custom Interwiki added:\n ${iw} -> ${name}",
"wiki.message.magic_word": "Note: The robot does not currently support magic words.", "wiki.message.magic_word": "Note: The robot does not currently support magic words.",
"wiki.message.not_found": "[${title}] not found.", "wiki.message.not_found": "[${title}] not found.",
"wiki.message.not_found.autofix": "Note: [${title}] does not exist. Did you mean: [${redirected_title}]?", "wiki.message.not_found.autofix": "Note: [${title}] does not exist. Did you mean: [${redirected_title}]?",