koishi-plugin-ets2-tools-tmp 3.1.0 → 3.1.1
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.
|
@@ -29,8 +29,23 @@ module.exports = async (ctx, cfg, session, tmpId) => {
|
|
|
29
29
|
if (!ctx.puppeteer) {
|
|
30
30
|
return '未启用 puppeteer 服务';
|
|
31
31
|
}
|
|
32
|
-
if (tmpId &&
|
|
33
|
-
|
|
32
|
+
if (tmpId && tmpId.startsWith("<at ")) {
|
|
33
|
+
let queryQQ = tmpId.replace('<at ', '');
|
|
34
|
+
let id = '';
|
|
35
|
+
const idStart = queryQQ.indexOf('id="');
|
|
36
|
+
if (idStart !== -1) {
|
|
37
|
+
const valueStart = idStart + 4;
|
|
38
|
+
const valueEnd = queryQQ.indexOf('"', valueStart);
|
|
39
|
+
if (valueEnd !== -1) {
|
|
40
|
+
id = queryQQ.substring(valueStart, valueEnd);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
queryQQ = id;
|
|
44
|
+
let guildBindData = await guildBind.get(ctx.database, session.platform, queryQQ);
|
|
45
|
+
if (!guildBindData) {
|
|
46
|
+
return `该用户没有绑定玩家编号`;
|
|
47
|
+
}
|
|
48
|
+
tmpId = guildBindData.tmp_id;
|
|
34
49
|
}
|
|
35
50
|
// 如果没有传入tmpId,尝试从数据库查询绑定信息
|
|
36
51
|
if (!tmpId) {
|