koishi-plugin-cat-raising 0.1.1 → 0.1.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.js +7 -5
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -112,9 +112,9 @@ function parseEvents(text) {
|
|
|
112
112
|
__name(parseEvents, "parseEvents");
|
|
113
113
|
function apply(ctx, config) {
|
|
114
114
|
const forwardedHistory = [];
|
|
115
|
-
const HISTORY_SIZE =
|
|
115
|
+
const HISTORY_SIZE = 10;
|
|
116
116
|
const REJECTION_KEYWORDS = ["签到", "打卡"];
|
|
117
|
-
const OVERRIDE_KEYWORDS = ["神金", "发"
|
|
117
|
+
const OVERRIDE_KEYWORDS = ["神金", "发"];
|
|
118
118
|
ctx.on("message", async (session) => {
|
|
119
119
|
if (session.channelId !== config.monitorGroup) return;
|
|
120
120
|
const originalMessageContent = session.content;
|
|
@@ -148,8 +148,8 @@ function apply(ctx, config) {
|
|
|
148
148
|
ctx.logger.info(`纯数字信息缺少时间,已忽略: ${messageForChecks.replace(/\s+/g, " ").substring(0, 50)}...`);
|
|
149
149
|
return;
|
|
150
150
|
}
|
|
151
|
-
if (forwardedHistory.some((entry) => entry.
|
|
152
|
-
session.send(
|
|
151
|
+
if (forwardedHistory.some((entry) => entry.roomId === roomId)) {
|
|
152
|
+
session.send(`看到啦看到啦,不要发那么多次嘛~`);
|
|
153
153
|
return;
|
|
154
154
|
}
|
|
155
155
|
let biliInfo = "";
|
|
@@ -189,7 +189,9 @@ function apply(ctx, config) {
|
|
|
189
189
|
const newEntry = {
|
|
190
190
|
originalMessageId: messageId,
|
|
191
191
|
forwardedMessageId,
|
|
192
|
-
originalContent: originalMessageContent
|
|
192
|
+
originalContent: originalMessageContent,
|
|
193
|
+
roomId
|
|
194
|
+
// 新增
|
|
193
195
|
};
|
|
194
196
|
forwardedHistory.push(newEntry);
|
|
195
197
|
if (forwardedHistory.length > HISTORY_SIZE) {
|