Feat: #7
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import client from "@/lib/client";
|
||||
import config from "@/lib/config";
|
||||
import initI18n from "@/lib/i18n";
|
||||
import Memory from "@/lib/memory";
|
||||
import { format } from "date-fns";
|
||||
import i18next from "i18next";
|
||||
import { readFileSync } from "node:fs";
|
||||
@@ -39,11 +40,21 @@ if (config.earthquake?.useHistoryData) {
|
||||
? JSON.parse(event.data)
|
||||
: event.data;
|
||||
} catch (err) {
|
||||
console.error(`メッセージのパースでエラーが発生: ${err}`);
|
||||
console.error(`地震情報メッセージのパースでエラーが発生: ${err}`);
|
||||
return;
|
||||
}
|
||||
|
||||
const mem = Memory.memory;
|
||||
if (mem.processedInfo.includes(message.id) && !config.debug) {
|
||||
console.log("重複した地震情報: ", message.id);
|
||||
return;
|
||||
}
|
||||
|
||||
processMessage(message);
|
||||
if (!config.debug) {
|
||||
mem.processedInfo.concat([message.id]);
|
||||
Memory.memory = mem;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ class MemoryClass {
|
||||
constructor() {
|
||||
if (!existsSync(path)) {
|
||||
writeFileSync(path, JSON.stringify({
|
||||
processedInfo: [],
|
||||
repliedUeuse: [],
|
||||
permissions: {},
|
||||
userid: "",
|
||||
|
||||
Reference in New Issue
Block a user