koishi-plugin-onebot-verifier 1.2.4 → 1.2.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.
- package/lib/index.js +6 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -113,6 +113,11 @@ 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.userId && session.bot) {
|
|
117
|
+
const rejectMsg = `已拒绝该群组邀请${reason ? `,原因:${reason}` : ""}`;
|
|
118
|
+
await session.bot.sendPrivateMessage(session.userId, rejectMsg).catch(() => {
|
|
119
|
+
});
|
|
120
|
+
}
|
|
116
121
|
if (!pass && kind === "guild" && session.guildId && (session.event?.type === "guild-added" || eventData.notice_type === "group_increase")) {
|
|
117
122
|
if (reason) await session.bot?.sendMessage(session.guildId, `${reason},将退出该群`).catch(() => {
|
|
118
123
|
});
|
|
@@ -143,7 +148,7 @@ function apply(ctx, config) {
|
|
|
143
148
|
const groupInfo = kind !== "friend" && session.guildId ? await session.bot.getGuild?.(session.guildId).catch(() => null) : null;
|
|
144
149
|
const adminId = String(eventData.operator_id || session.event?.operator?.id || "");
|
|
145
150
|
const adminInfo = adminId && adminId !== session.userId ? await session.bot.getUser?.(adminId).catch(() => null) : null;
|
|
146
|
-
const typeMap = { friend: "好友申请", member: "加群请求", guild: eventData.post_type === "notice" ? "群组邀请
|
|
151
|
+
const typeMap = { friend: "好友申请", member: "加群请求", guild: eventData.post_type === "notice" ? "群组邀请 (通过)" : "群组邀请 (请求)", removed: eventData.sub_type === "kick_me" ? "移出群组" : "退出群组" };
|
|
147
152
|
const statusMap = { auto_pass: " [自动通过]", auto_reject: " [自动拒绝]", waiting: " [等待处理]" };
|
|
148
153
|
const infoLines = [];
|
|
149
154
|
if (userInfo?.avatar) infoLines.push(`<image url="${userInfo.avatar}"/>`);
|
package/package.json
CHANGED