koishi-plugin-onebot-verifier 1.2.5 → 1.2.6
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.js +8 -5
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -113,10 +113,13 @@ function apply(ctx, config) {
|
|
|
113
113
|
const eventData = session.event?._data || {};
|
|
114
114
|
if (config.debugMode) logger.info(`[操作] 类型: ${kind} 结果: ${pass ? "同意" : "拒绝"} 原因: ${reason || "无"}`);
|
|
115
115
|
if (pass && kind === "guild" && session.guildId && session.userId) inviterMap.set(session.guildId, session.userId);
|
|
116
|
-
if (!pass && kind === "guild" && session.
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
|
|
116
|
+
if (!pass && kind === "guild" && session.bot) {
|
|
117
|
+
const targetId = eventData.operator_id || session.event?.operator?.id || session.userId;
|
|
118
|
+
if (targetId) {
|
|
119
|
+
const rejectMsg = `已拒绝该群组邀请${reason ? `,原因:${reason}` : ""}`;
|
|
120
|
+
await session.bot.sendPrivateMessage(targetId, rejectMsg).catch(() => {
|
|
121
|
+
});
|
|
122
|
+
}
|
|
120
123
|
}
|
|
121
124
|
if (!pass && kind === "guild" && session.guildId && (session.event?.type === "guild-added" || eventData.notice_type === "group_increase")) {
|
|
122
125
|
if (reason) await session.bot?.sendMessage(session.guildId, `${reason},将退出该群`).catch(() => {
|
|
@@ -148,7 +151,7 @@ function apply(ctx, config) {
|
|
|
148
151
|
const groupInfo = kind !== "friend" && session.guildId ? await session.bot.getGuild?.(session.guildId).catch(() => null) : null;
|
|
149
152
|
const adminId = String(eventData.operator_id || session.event?.operator?.id || "");
|
|
150
153
|
const adminInfo = adminId && adminId !== session.userId ? await session.bot.getUser?.(adminId).catch(() => null) : null;
|
|
151
|
-
const typeMap = { friend: "好友申请", member: "加群请求", guild: eventData.post_type === "notice" ? "群组邀请 (
|
|
154
|
+
const typeMap = { friend: "好友申请", member: "加群请求", guild: eventData.post_type === "notice" ? "群组邀请 (审核)" : "群组邀请 (请求)", removed: eventData.sub_type === "kick_me" ? "移出群组" : "退出群组" };
|
|
152
155
|
const statusMap = { auto_pass: " [自动通过]", auto_reject: " [自动拒绝]", waiting: " [等待处理]" };
|
|
153
156
|
const infoLines = [];
|
|
154
157
|
if (userInfo?.avatar) infoLines.push(`<image url="${userInfo.avatar}"/>`);
|
package/package.json
CHANGED