📚 优化翻译
This commit is contained in:
parent
ea0c2b009f
commit
4491525eee
@ -11,7 +11,7 @@ from pagermaid.modules import plugin_list as active_plugins, __list_plugins
|
||||
|
||||
|
||||
@listener(outgoing=True, command="plugin", diagnostics=False,
|
||||
description="用于管理安装到 PagerMaid 的插件。",
|
||||
description="用于管理安装到 PagerMaid-Modify 的插件。",
|
||||
parameters="{status|install|remove|enable|disable|upload} <插件名称/文件>")
|
||||
async def plugin(context):
|
||||
if len(context.parameter) > 2 or len(context.parameter) == 0:
|
||||
@ -41,7 +41,7 @@ async def plugin(context):
|
||||
move(file_path, f"{plugin_directory}{file_path}.disabled")
|
||||
else:
|
||||
move(file_path, plugin_directory)
|
||||
await context.edit(f"插件 {path.basename(file_path)[:-3]} 已安装,PagerMaid 正在重新启动。")
|
||||
await context.edit(f"插件 {path.basename(file_path)[:-3]} 已安装,PagerMaid-Modify 正在重新启动。")
|
||||
await log(f"成功安装插件 {path.basename(file_path)[:-3]}.")
|
||||
await context.client.disconnect()
|
||||
else:
|
||||
@ -50,7 +50,7 @@ async def plugin(context):
|
||||
if len(context.parameter) == 2:
|
||||
if exists(f"{plugin_directory}{context.parameter[1]}.py"):
|
||||
remove(f"{plugin_directory}{context.parameter[1]}.py")
|
||||
await context.edit(f"成功删除插件 {context.parameter[1]}, PagerMaid 正在重新启动。")
|
||||
await context.edit(f"成功删除插件 {context.parameter[1]}, PagerMaid-Modify 正在重新启动。")
|
||||
await log(f"删除插件 {context.parameter[1]}.")
|
||||
await context.client.disconnect()
|
||||
elif exists(f"{plugin_directory}{context.parameter[1]}.py.disabled"):
|
||||
@ -104,7 +104,7 @@ async def plugin(context):
|
||||
if exists(f"{plugin_directory}{context.parameter[1]}.py.disabled"):
|
||||
rename(f"{plugin_directory}{context.parameter[1]}.py.disabled",
|
||||
f"{plugin_directory}{context.parameter[1]}.py")
|
||||
await context.edit(f"插件 {context.parameter[1]} 已启用,PagerMaid 正在重新启动。")
|
||||
await context.edit(f"插件 {context.parameter[1]} 已启用,PagerMaid-Modify 正在重新启动。")
|
||||
await log(f"已启用 {context.parameter[1]}.")
|
||||
await context.client.disconnect()
|
||||
else:
|
||||
@ -116,7 +116,7 @@ async def plugin(context):
|
||||
if exists(f"{plugin_directory}{context.parameter[1]}.py") is True:
|
||||
rename(f"{plugin_directory}{context.parameter[1]}.py",
|
||||
f"{plugin_directory}{context.parameter[1]}.py.disabled")
|
||||
await context.edit(f"插件 {context.parameter[1]} 已被禁用,PagerMaid 正在重新启动。")
|
||||
await context.edit(f"插件 {context.parameter[1]} 已被禁用,PagerMaid-Modify 正在重新启动。")
|
||||
await log(f"已关闭插件 {context.parameter[1]}.")
|
||||
await context.client.disconnect()
|
||||
else:
|
||||
@ -137,7 +137,7 @@ async def plugin(context):
|
||||
await context.edit("上传插件中 . . .")
|
||||
await upload_attachment(file_name,
|
||||
context.chat_id, reply_id,
|
||||
caption=f"PagerMaid {context.parameter[1]} plugin.")
|
||||
caption=f"PagerMaid-Modify {context.parameter[1]} plugin.")
|
||||
remove(file_name)
|
||||
await context.delete()
|
||||
else:
|
||||
|
@ -10,7 +10,7 @@ from pagermaid.utils import obtain_message, upload_attachment
|
||||
|
||||
|
||||
@listener(outgoing=True, command="genqr",
|
||||
description="生成包含文字内容的 QR Code 。",
|
||||
description="生成 QR Code 。",
|
||||
parameters="<string>")
|
||||
async def genqr(context):
|
||||
""" Generate QR codes. """
|
||||
@ -20,11 +20,11 @@ async def genqr(context):
|
||||
except ValueError:
|
||||
await context.edit("出错了呜呜呜 ~ 无效的参数。")
|
||||
return
|
||||
await context.edit("生成QR码。")
|
||||
await context.edit("生成QR码中。。。")
|
||||
try:
|
||||
create(message, error='L', mode='binary').png('qr.webp', scale=6)
|
||||
except UnicodeEncodeError:
|
||||
await context.edit("出错了呜呜呜 ~ 目标消息中的字符无效。")
|
||||
await context.edit("出错了呜呜呜 ~ 解析目标消息中的字符出现错误。")
|
||||
return
|
||||
await upload_attachment("qr.webp", context.chat_id, reply_id)
|
||||
remove("qr.webp")
|
||||
@ -33,7 +33,7 @@ async def genqr(context):
|
||||
|
||||
|
||||
@listener(outgoing=True, command="parseqr",
|
||||
description="将回复的消息文件解析为 QR码 并输出结果。")
|
||||
description="回复一张 QR 码进行解析并发送 QR 码内容。")
|
||||
async def parseqr(context):
|
||||
""" Parse attachment of replied message as a QR Code and output results. """
|
||||
success = False
|
||||
|
@ -43,15 +43,15 @@ async def tty(context):
|
||||
reply_id = context.message.reply_to_msg_id
|
||||
result = await execute("fbdump | magick - image.png")
|
||||
if result == "/bin/sh: fbdump: command not found":
|
||||
await context.edit("出错了呜呜呜 ~ 此系统上没有 fbdump")
|
||||
await context.edit("出错了呜呜呜 ~ 此系统上没有安装 fbdump")
|
||||
remove("image.png")
|
||||
return
|
||||
if result == "/bin/sh: convert: command not found":
|
||||
await context.edit("出错了呜呜呜 ~ ImageMagick 在该系统上不存在。")
|
||||
await context.edit("出错了呜呜呜 ~ 此系统上没有安装 ImageMagick")
|
||||
remove("image.png")
|
||||
return
|
||||
if result == "Failed to open /dev/fb0: Permission denied":
|
||||
await context.edit("出错了呜呜呜 ~ 运行 PagerMaid 的用户不在视频组中。")
|
||||
await context.edit("出错了呜呜呜 ~ 运行 PagerMaid-Modify 的用户不在视频组中。")
|
||||
remove("image.png")
|
||||
return
|
||||
if not await upload_attachment("image.png", context.chat_id, reply_id,
|
||||
@ -65,11 +65,11 @@ async def tty(context):
|
||||
|
||||
|
||||
@listener(outgoing=True, command="status",
|
||||
description="输出 PagerMaid 的状态。")
|
||||
description="输出 PagerMaid-Modify 的状态。")
|
||||
async def status(context):
|
||||
database = "Connected" if redis_status() else "Disconnected"
|
||||
await context.edit(
|
||||
f"**PagerMaid 状态** \n"
|
||||
f"**PagerMaid-Modify 状态** \n"
|
||||
f"主机名: `{uname().node}` \n"
|
||||
f"主机平台: `{platform}` \n"
|
||||
f"Kernel 版本: `{uname().release}` \n"
|
||||
@ -80,7 +80,7 @@ async def status(context):
|
||||
|
||||
|
||||
@listener(outgoing=True, command="speedtest",
|
||||
description="执行 speedtest 脚本并输出您的互联网速度。")
|
||||
description="执行 speedtest 脚本并发送结果。")
|
||||
async def speedtest(context):
|
||||
""" Tests internet speed using speedtest. """
|
||||
await context.edit("执行测试脚本 . . .")
|
||||
@ -100,7 +100,7 @@ async def speedtest(context):
|
||||
|
||||
|
||||
@listener(outgoing=True, command="connection",
|
||||
description="显示 PagerMaid 和 Telegram 之间的连接信息。")
|
||||
description="显示 PagerMaid-Modify 和 Telegram 之间的连接信息。")
|
||||
async def connection(context):
|
||||
""" Displays connection information between PagerMaid and Telegram. """
|
||||
datacenter = await context.client(functions.help.GetNearestDcRequest())
|
||||
@ -113,7 +113,7 @@ async def connection(context):
|
||||
|
||||
|
||||
@listener(outgoing=True, command="ping",
|
||||
description="计算 PagerMaid 和 Telegram 之间的延迟。")
|
||||
description="计算 PagerMaid-Modify 和 Telegram 之间的延迟。")
|
||||
async def ping(context):
|
||||
""" Calculates latency between PagerMaid and Telegram. """
|
||||
start = datetime.now()
|
||||
|
@ -11,7 +11,7 @@ from pagermaid.utils import attach_log, execute
|
||||
|
||||
|
||||
@listener(outgoing=True, command="sh",
|
||||
description="在 Telegram 上执行 Shell 命令。",
|
||||
description="在 Telegram 上远程执行 Shell 命令。",
|
||||
parameters="<命令>")
|
||||
async def sh(context):
|
||||
""" Use the command-line from Telegram. """
|
||||
@ -19,7 +19,7 @@ async def sh(context):
|
||||
command = context.arguments
|
||||
hostname = node()
|
||||
if context.is_channel and not context.is_group:
|
||||
await context.edit("`出错了呜呜呜 ~ 当前配置禁止在频道中执行 Shell 命令。`")
|
||||
await context.edit("`出错了呜呜呜 ~ 当前 PagerMaid-Modify 的配置禁止在频道中执行 Shell 命令。`")
|
||||
return
|
||||
|
||||
if not command:
|
||||
@ -58,15 +58,15 @@ async def sh(context):
|
||||
)
|
||||
else:
|
||||
return
|
||||
await log(f"在 Shell 中执行命令 `{command}`")
|
||||
await log(f"远程执行 Shell 命令: `{command}`")
|
||||
|
||||
|
||||
@listener(outgoing=True, command="restart", diagnostics=False,
|
||||
description="使 PagerMaid 重新启动")
|
||||
description="使 PagerMaid-Modify 重新启动")
|
||||
async def restart(context):
|
||||
""" To re-execute PagerMaid. """
|
||||
if not context.text[0].isalpha():
|
||||
await context.edit("尝试重新启动系统。")
|
||||
await context.edit("尝试重新启动 PagerMaid-Modify 。")
|
||||
await log("PagerMaid-Modify 重新启动。")
|
||||
await context.client.disconnect()
|
||||
|
||||
@ -108,7 +108,7 @@ async def trace(context):
|
||||
await log(f"Traced redirects of {context.arguments}.")
|
||||
else:
|
||||
await context.edit(
|
||||
"出错了呜呜呜 ~ 发出HTTP请求时出了点问题。"
|
||||
"出错了呜呜呜 ~ 发出 HTTP 请求时出了点问题。"
|
||||
)
|
||||
else:
|
||||
await context.edit("无效的参数。")
|
||||
|
Loading…
Reference in New Issue
Block a user