koishi-plugin-minecraft-search 2.0.10 → 2.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/index.js +5 -5
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -100,7 +100,7 @@ function apply(ctx, config) {
100
100
  async function minekuaiApiRequest(instanceId, operation, groupId, maxRetries = 3) {
101
101
  const apiKeys = await ctx.database.get("minecraft_api_key", { groupId });
102
102
  if (!apiKeys || apiKeys.length === 0) {
103
- throw new Error("本群未配置麦块API密钥,请先使用 绑定密钥 指令");
103
+ throw new Error("本群未配置麦块API密钥,请先使用 绑定API密钥 指令");
104
104
  }
105
105
  const apiKeyRecord = apiKeys[0];
106
106
  const baseUrl = config.minekuaiApiUrl.replace(/\/+$/, "");
@@ -348,7 +348,7 @@ function apply(ctx, config) {
348
348
  服务器ID: ${newServer.id}
349
349
  名称: ${newServer.name || "Minecraft 服务器"}`;
350
350
  });
351
- ctx.guild().command("mc/绑定密钥 <apiKey:string>", "绑定麦块API密钥").action(async ({ session }, apiKey) => {
351
+ ctx.guild().command("mc/绑定API密钥 <apiKey:string>", "绑定麦块API密钥").action(async ({ session }, apiKey) => {
352
352
  const permissionError = await checkPermission(session, config);
353
353
  if (permissionError) {
354
354
  return permissionError;
@@ -490,7 +490,7 @@ ${parts.join("\n")}`;
490
490
  try {
491
491
  const apiKeys = await ctx.database.get("minecraft_api_key", { groupId });
492
492
  if (!apiKeys || apiKeys.length === 0) {
493
- throw new Error("本群未配置麦块API密钥,请先使用 绑定密钥 指令");
493
+ throw new Error("本群未配置麦块API密钥,请先使用 绑定API密钥 指令");
494
494
  }
495
495
  const apiKeyRecord = apiKeys[0];
496
496
  const baseUrl = config.minekuaiApiUrl.replace(/\/+$/, "");
@@ -549,7 +549,7 @@ ${parts.join("\n")}`;
549
549
 
550
550
  `;
551
551
  servers.forEach((server) => {
552
- const activeStatus = server.active === false ? " 不活跃" : " 活跃";
552
+ const activeStatus = server.active === false ? "🔴 不活跃" : "🟢 活跃";
553
553
  message += `[ID:${server.id}] ${server.name} | ${activeStatus}
554
554
  `;
555
555
  if (config.showIpInDetail) {
@@ -598,7 +598,7 @@ ${parts.join("\n")}`;
598
598
  return `❌ 未找到ID为 ${id} 的服务器`;
599
599
  }
600
600
  if (!status) {
601
- const activeStatus = server.active === false ? " 不活跃" : " 活跃";
601
+ const activeStatus = server.active === false ? "🔴 不活跃" : "🟢 活跃";
602
602
  return `📋 ${server.name} (ID: ${id}) 状态:${activeStatus}`;
603
603
  } else if (status === "启用") {
604
604
  await ctx.database.set("minecraft_server", { id }, { active: true });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-minecraft-search",
3
3
  "description": "用于查询Minecraft服务器状态。如果服务器来自于麦块联机,那么可以查询指定服务器的详细资源使用情况,甚至还能对指定服务器进行电源开启或重启操作",
4
- "version": "2.0.10",
4
+ "version": "2.0.11",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [