koishi-plugin-noah 1.7.1 → 1.7.2
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.cjs +9 -6
- package/package.json +1 -1
package/lib/index.cjs
CHANGED
|
@@ -1626,10 +1626,13 @@ async function addServer(ctx, session, serverService, userService, from, uid, us
|
|
|
1626
1626
|
}
|
|
1627
1627
|
const serverType = serverValues[selectNum - 1];
|
|
1628
1628
|
let url;
|
|
1629
|
+
let serverName;
|
|
1629
1630
|
if (serverType === "mao") {
|
|
1630
1631
|
url = ctx.config.maoServerUrl;
|
|
1632
|
+
serverName = "MaoMaNi";
|
|
1631
1633
|
} else if (serverType === "official") {
|
|
1632
|
-
url = ctx.config.
|
|
1634
|
+
url = ctx.config.official_support_url;
|
|
1635
|
+
serverName = "Official";
|
|
1633
1636
|
} else {
|
|
1634
1637
|
let attempts = 0;
|
|
1635
1638
|
const maxAttempts = 3;
|
|
@@ -1650,12 +1653,12 @@ async function addServer(ctx, session, serverService, userService, from, uid, us
|
|
|
1650
1653
|
url = normalizedUrl;
|
|
1651
1654
|
break;
|
|
1652
1655
|
}
|
|
1656
|
+
await session.send(session.text(".add-name"));
|
|
1657
|
+
serverName = await session.prompt();
|
|
1658
|
+
if (!serverName) return session.text("commands.timeout");
|
|
1659
|
+
if (serverName === "q") return session.text(".quit");
|
|
1660
|
+
if (serverName.includes(" ")) return session.text(".add-invalid-name");
|
|
1653
1661
|
}
|
|
1654
|
-
await session.send(session.text(".add-name"));
|
|
1655
|
-
const serverName = await session.prompt();
|
|
1656
|
-
if (!serverName) return session.text("commands.timeout");
|
|
1657
|
-
if (serverName === "q") return session.text(".quit");
|
|
1658
|
-
if (serverName.includes(" ")) return session.text(".add-invalid-name");
|
|
1659
1662
|
if (from === "user") {
|
|
1660
1663
|
const res = await serverService.createServerForUser(
|
|
1661
1664
|
{
|