@karinjs/adapter-qqbot 3.0.6 → 3.0.8
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/dist/apps/login.js +2 -2
- package/dist/index.js +1 -2
- package/package.json +1 -1
package/dist/apps/login.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as getDefaultConfig, n as config } from "../config-D1_LqrcJ.js";
|
|
1
|
+
import { i as getDefaultConfig, n as config, o as writeConfig } from "../config-D1_LqrcJ.js";
|
|
2
2
|
import karin, { segment } from "node-karin";
|
|
3
3
|
import qrcode from "qrcode";
|
|
4
4
|
import axios from "node-karin/axios";
|
|
@@ -148,7 +148,7 @@ const QQBotLogin = karin.command(/^#qqbot(登录|login)$/i, async (e) => {
|
|
|
148
148
|
});
|
|
149
149
|
e.reply(`[${ok.appId}] 扫码登录成功`, { reply: true });
|
|
150
150
|
}
|
|
151
|
-
return;
|
|
151
|
+
return writeConfig(list);
|
|
152
152
|
}
|
|
153
153
|
return await e.reply("二维码过期,请重新触发指令", { reply: true });
|
|
154
154
|
} finally {
|
package/dist/index.js
CHANGED
|
@@ -4448,14 +4448,13 @@ const QUICK_DISCONNECT_DELAY_MS = 6e4;
|
|
|
4448
4448
|
* 获取网关地址:优先调 /gateway;失败 / 超时 / 限频 → 直接 fallback 到硬编码
|
|
4449
4449
|
*/
|
|
4450
4450
|
const fetchGateway = async (cfg) => {
|
|
4451
|
-
const apiUrl = "https://api.bot.qq.com";
|
|
4452
4451
|
const accessToken = getBotAccessToken(cfg.appId);
|
|
4453
4452
|
if (!accessToken) {
|
|
4454
4453
|
log("warn", `${cfg.appId}: 无 access_token,使用硬编码 WS`);
|
|
4455
4454
|
return "wss://api.bot.qq.com/websocket";
|
|
4456
4455
|
}
|
|
4457
4456
|
try {
|
|
4458
|
-
const { data } = await axios.get(
|
|
4457
|
+
const { data } = await axios.get(`${QQAPIBASEURL}/gateway`, {
|
|
4459
4458
|
headers: {
|
|
4460
4459
|
Authorization: `QQBot ${accessToken}`,
|
|
4461
4460
|
"User-Agent": getUserAgent()
|