koishi-plugin-chatluna-character 0.0.40 → 0.0.41
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/plugins/filter.js
CHANGED
|
@@ -59,25 +59,23 @@ async function apply(ctx, config) {
|
|
|
59
59
|
if (needMute) {
|
|
60
60
|
logger.debug(`mute content: ${message.content}`);
|
|
61
61
|
service.mute(session, config.muteTime);
|
|
62
|
-
return;
|
|
63
62
|
}
|
|
64
63
|
}
|
|
65
|
-
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
64
|
+
const isMute = service.isMute(session);
|
|
68
65
|
// 保底必出
|
|
69
|
-
if (messageCount > maxMessages ||
|
|
66
|
+
if ((messageCount > maxMessages ||
|
|
70
67
|
messageSendProbability > 1 ||
|
|
71
68
|
session.stripped.appel ||
|
|
72
69
|
(config.isNickname &&
|
|
73
|
-
currentPreset.nick_name.some((value) => message.content.startsWith(value))))
|
|
70
|
+
currentPreset.nick_name.some((value) => message.content.startsWith(value)))) &&
|
|
71
|
+
!isMute) {
|
|
74
72
|
info.messageCount = 0;
|
|
75
73
|
info.messageSendProbability = 1;
|
|
76
74
|
exports.groupInfos[session.guildId] = info;
|
|
77
75
|
return true;
|
|
78
76
|
}
|
|
79
77
|
// 按照概率出
|
|
80
|
-
if (Math.random() > messageSendProbability) {
|
|
78
|
+
if (Math.random() > messageSendProbability && !isMute) {
|
|
81
79
|
info.messageCount = 0;
|
|
82
80
|
info.messageSendProbability = 1;
|
|
83
81
|
exports.groupInfos[session.guildId] = info;
|
|
@@ -11,7 +11,7 @@ function apply(ctx, config) {
|
|
|
11
11
|
}
|
|
12
12
|
// 检查是否在名单里面
|
|
13
13
|
if (config.disableChatLuna &&
|
|
14
|
-
config.whiteListDisableChatLuna
|
|
14
|
+
config.whiteListDisableChatLuna?.includes(guildId)) {
|
|
15
15
|
// check to last five message is send for bot
|
|
16
16
|
const selfId = session.bot.userId ?? session.bot.selfId ?? '0';
|
|
17
17
|
const guildMessages = ctx.chatluna_character.getMessages(guildId);
|
|
@@ -19,7 +19,7 @@ function apply(ctx, config) {
|
|
|
19
19
|
return true;
|
|
20
20
|
}
|
|
21
21
|
let maxRecentMessage = 0;
|
|
22
|
-
while (maxRecentMessage <
|
|
22
|
+
while (maxRecentMessage < 3) {
|
|
23
23
|
const currentMessage = guildMessages[guildMessages?.length - 1 - maxRecentMessage];
|
|
24
24
|
if (currentMessage == null) {
|
|
25
25
|
return false;
|
package/package.json
CHANGED