koishi-plugin-bind-bot 2.2.7 → 2.2.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.
@@ -114,6 +114,12 @@ class GroupRequestReviewHandler extends base_handler_1.BaseHandler {
114
114
  const msgId = messageId.toString();
115
115
  const emojiData = likes;
116
116
  const operatorId = this.deps.normalizeQQId(userId);
117
+ // 忽略 bot 自己的表情回应(addReactionOptions 添加表情时也会触发此事件)
118
+ const botId = this.deps.normalizeQQId(session.bot.selfId);
119
+ if (operatorId === botId) {
120
+ this.logger.debug('入群审批', `忽略 bot 自己的表情回应 - 消息: ${msgId}`);
121
+ return;
122
+ }
117
123
  this.logger.debug('入群审批', `收到表情回应 - 消息: ${msgId}, 操作者: ${operatorId}, 表情数: ${emojiData.length}`);
118
124
  // 检查是否是待审批的消息
119
125
  const pendingReq = this.pendingRequests.get(msgId);
@@ -177,6 +183,8 @@ class GroupRequestReviewHandler extends base_handler_1.BaseHandler {
177
183
  buidUid = parsedUid;
178
184
  // 尝试使用强制绑定模式获取完整信息(避免频率限制)
179
185
  let zminfoData = null;
186
+ // 存储强制绑定模式下获取的目标粉丝牌信息
187
+ let targetMedalInfo = null;
180
188
  if (this.config.forceBindSessdata) {
181
189
  try {
182
190
  this.logger.debug('入群审批', '使用强制绑定模式获取用户信息...');
@@ -184,7 +192,9 @@ class GroupRequestReviewHandler extends base_handler_1.BaseHandler {
184
192
  const standardUser = this.deps.forceBinder.convertToZminfoUser(enhancedUser);
185
193
  buidUsername = standardUser.username;
186
194
  zminfoData = standardUser;
187
- this.logger.debug('入群审批', `✅ 强制绑定模式获取成功: ${buidUsername}`);
195
+ // 保存目标粉丝牌信息,用于后续显示
196
+ targetMedalInfo = enhancedUser.targetMedal || null;
197
+ this.logger.debug('入群审批', `✅ 强制绑定模式获取成功: ${buidUsername}, 目标粉丝牌: ${targetMedalInfo?.found ? '已找到' : '未找到'}`);
188
198
  }
189
199
  catch (error) {
190
200
  this.logger.warn('入群审批', `强制绑定获取用户信息失败: ${error.message},降级到ZMINFO`);
@@ -205,8 +215,21 @@ class GroupRequestReviewHandler extends base_handler_1.BaseHandler {
205
215
  this.logger.debug('入群审批', `✅ ZMINFO用户名: ${buidUsername}`);
206
216
  }
207
217
  }
208
- // 粉丝牌信息:从ZMINFO或强制绑定结果获取
209
- if (zminfoData) {
218
+ // 粉丝牌信息:优先使用强制绑定获取的目标粉丝牌,其次使用ZMINFO的当前佩戴粉丝牌
219
+ if (targetMedalInfo) {
220
+ // 使用强制绑定模式获取的目标粉丝牌信息(从B站粉丝牌墙获取,更准确)
221
+ if (targetMedalInfo.found && targetMedalInfo.name && targetMedalInfo.level !== undefined) {
222
+ medalInfo = `🎖️ ${targetMedalInfo.name} Lv.${targetMedalInfo.level}`;
223
+ if (targetMedalInfo.wearing_status === 1) {
224
+ medalInfo += ' 【已佩戴】';
225
+ }
226
+ }
227
+ else {
228
+ medalInfo = `⚠️ 未获取到 "${this.config.forceBindTargetMedalName}" 粉丝牌`;
229
+ }
230
+ }
231
+ else if (zminfoData) {
232
+ // 降级:使用ZMINFO的当前佩戴粉丝牌信息
210
233
  const medalLevel = zminfoData.medal?.level || 0;
211
234
  const medalName = zminfoData.medal?.name || '';
212
235
  if (medalName === this.config.forceBindTargetMedalName) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-bind-bot",
3
3
  "description": "[WittF自用] BIND-BOT - 账号绑定管理机器人,支持Minecraft账号和B站账号绑定与管理。",
4
- "version": "2.2.7",
4
+ "version": "2.2.8",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [