3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-15 06:05:03 +00:00

MessageSaver: use a queue, add more logging for duplicate IDs

This commit is contained in:
Dragory 2021-08-20 21:00:53 +03:00
parent ebe224885e
commit 7054412640
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
4 changed files with 37 additions and 6 deletions

View file

@ -5,6 +5,7 @@ import { SaveMessagesToDBCmd } from "./commands/SaveMessagesToDB";
import { SavePinsToDBCmd } from "./commands/SavePinsToDB";
import { MessageCreateEvt, MessageDeleteBulkEvt, MessageDeleteEvt, MessageUpdateEvt } from "./events/SaveMessagesEvts";
import { ConfigSchema, MessageSaverPluginType } from "./types";
import { Queue } from "../../Queue";
const defaultOptions: PluginOptions<MessageSaverPluginType> = {
config: {
@ -44,5 +45,6 @@ export const MessageSaverPlugin = zeppelinGuildPlugin<MessageSaverPluginType>()(
beforeLoad(pluginData) {
const { state, guild } = pluginData;
state.savedMessages = GuildSavedMessages.getGuildInstance(guild.id);
state.queue = new Queue();
},
});