koishi-plugin-onebot-verifier 1.2.4 → 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 +9 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -113,6 +113,14 @@ 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.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
|
+
}
|
|
123
|
+
}
|
|
116
124
|
if (!pass && kind === "guild" && session.guildId && (session.event?.type === "guild-added" || eventData.notice_type === "group_increase")) {
|
|
117
125
|
if (reason) await session.bot?.sendMessage(session.guildId, `${reason},将退出该群`).catch(() => {
|
|
118
126
|
});
|
|
@@ -143,7 +151,7 @@ function apply(ctx, config) {
|
|
|
143
151
|
const groupInfo = kind !== "friend" && session.guildId ? await session.bot.getGuild?.(session.guildId).catch(() => null) : null;
|
|
144
152
|
const adminId = String(eventData.operator_id || session.event?.operator?.id || "");
|
|
145
153
|
const adminInfo = adminId && adminId !== session.userId ? await session.bot.getUser?.(adminId).catch(() => null) : null;
|
|
146
|
-
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" ? "移出群组" : "退出群组" };
|
|
147
155
|
const statusMap = { auto_pass: " [自动通过]", auto_reject: " [自动拒绝]", waiting: " [等待处理]" };
|
|
148
156
|
const infoLines = [];
|
|
149
157
|
if (userInfo?.avatar) infoLines.push(`<image url="${userInfo.avatar}"/>`);
|
package/package.json
CHANGED