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.
- package/lib/index.js +5 -5
- 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
|
|
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