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 && isNaN(tmpId)) {
33
- return `请输入正确的玩家编号`;
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) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-ets2-tools-tmp",
3
3
  "description": "欧卡2 TruckersMP信息查询、车队平台查询及活动提醒",
4
- "version": "3.1.0",
4
+ "version": "3.1.1",
5
5
  "contributors": [
6
6
  "opwop <slhp1013@qq.com>",
7
7
  "bot_actions <168329908@qq.com>"