koishi-plugin-echo-cave 1.16.2 → 1.16.3
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/lib/index.cjs +12 -13
- package/package.json +1 -1
package/lib/index.cjs
CHANGED
|
@@ -375,32 +375,31 @@ async function getUserName(ctx, session, userId) {
|
|
|
375
375
|
async function checkUsersInGroupDebug(ctx, session, userIds) {
|
|
376
376
|
try {
|
|
377
377
|
const channelId = session.channelId;
|
|
378
|
-
|
|
378
|
+
ctx.logger.info(`
|
|
379
379
|
=== \u8C03\u8BD5\u4FE1\u606F\uFF1AcheckUsersInGroupDebug ===`);
|
|
380
|
-
|
|
380
|
+
ctx.logger.info(`channelId: ${channelId}`);
|
|
381
381
|
const groupMembers = await session.onebot.getGroupMemberList(channelId);
|
|
382
|
-
|
|
383
|
-
|
|
382
|
+
ctx.logger.info(`\u7FA4\u6210\u5458\u6570\u91CF\uFF1A${groupMembers.length}`);
|
|
383
|
+
ctx.logger.info(`\u7FA4\u6210\u5458ID\u5217\u8868\uFF1A${groupMembers.map((member) => member.user_id).join(", ")}`);
|
|
384
384
|
const memberIds = groupMembers.map((member) => member.user_id.toString());
|
|
385
|
-
|
|
386
|
-
console.log(`\u68C0\u67E5\u7684\u7528\u6237ID\uFF1A${userIds.join(", ")}`);
|
|
385
|
+
ctx.logger.info(`\u68C0\u67E5\u7684\u7528\u6237ID\uFF1A${userIds.join(", ")}`);
|
|
387
386
|
const usersNotHere = userIds.filter((userId) => !memberIds.includes(userId));
|
|
388
387
|
if (usersNotHere.length > 0) {
|
|
389
|
-
|
|
390
|
-
|
|
388
|
+
ctx.logger.info(`\u274C \u4E0D\u5728\u7FA4\u7EC4\u7684\u7528\u6237ID\uFF1A${usersNotHere.join(", ")}`);
|
|
389
|
+
ctx.logger.info(`=== \u8C03\u8BD5\u7ED3\u675F ===
|
|
391
390
|
`);
|
|
392
391
|
return false;
|
|
393
392
|
} else {
|
|
394
|
-
|
|
395
|
-
|
|
393
|
+
ctx.logger.info(`\u2705 \u6240\u6709\u7528\u6237\u90FD\u5728\u7FA4\u7EC4\u4E2D`);
|
|
394
|
+
ctx.logger.info(`=== \u8C03\u8BD5\u7ED3\u675F ===
|
|
396
395
|
`);
|
|
397
396
|
return true;
|
|
398
397
|
}
|
|
399
398
|
} catch (error) {
|
|
400
|
-
|
|
399
|
+
ctx.logger.warn(`
|
|
401
400
|
=== \u8C03\u8BD5\u9519\u8BEF\uFF1AcheckUsersInGroupDebug ===`);
|
|
402
|
-
|
|
403
|
-
|
|
401
|
+
ctx.logger.warn(`\u83B7\u53D6\u7FA4\u6210\u5458\u5217\u8868\u5931\u8D25\uFF1A`, error);
|
|
402
|
+
ctx.logger.warn(`=== \u8C03\u8BD5\u7ED3\u675F ===
|
|
404
403
|
`);
|
|
405
404
|
ctx.logger.warn(`\u83B7\u53D6\u7FA4\u6210\u5458\u5217\u8868\u5931\u8D25\uFF1A`, error);
|
|
406
405
|
return false;
|