koishi-plugin-ets2-tools-tmp 3.4.3 → 3.4.5

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.
@@ -45,8 +45,7 @@ async function pickAll(ctx, session, bindingRows) {
45
45
  if (list.length === 0) {
46
46
  return { ids: [], total: 0, truncated: false, hint: null };
47
47
  }
48
- // 补全旧数据缺失的玩家名(复用列表展示那套逻辑,保证提示文案准确)
49
- await guildBind.ensureNames(ctx, list);
48
+ // 这里只用到 tmp_id(hint 只报数量,不显示名字)→ 不刷新名字,省接口
50
49
  const { ids, total, truncated } = resolveAll(list);
51
50
  return {
52
51
  ids,
@@ -195,9 +194,10 @@ function register(ctx) {
195
194
  */
196
195
  async function pick(ctx, session, bindings, opts = {}) {
197
196
  if (!bindings || bindings.length === 0) return [];
198
- // 旧绑定的行没有名字:先查接口补全并写回,避免列表显示"未知"
199
- await guildBind.ensureNames(ctx, bindings);
197
+ // 单绑定:不显示列表,直接返回 —— 此时没必要刷新名字(查询本身会显示真实名字)
200
198
  if (bindings.length === 1) return [String(bindings[0].tmp_id)];
199
+ // 要显示序号列表了:查接口刷新名字,保证玩家改名后列表及时同步
200
+ await guildBind.refreshNames(ctx, bindings);
201
201
  const allowMulti = opts.allowMulti !== false;
202
202
  const allowAll = opts.allowAll !== false;
203
203
  const max = allowMulti ? MAX_PICK : 1;
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.4.3",
4
+ "version": "3.4.5",
5
5
  "contributors": [
6
6
  "opwop <slhp1013@qq.com>"
7
7
  ],