mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 04:25:01 +00:00
More initialization order fixes (vol 2)
This commit is contained in:
parent
22316eb714
commit
72637fe1b3
27 changed files with 97 additions and 44 deletions
|
@ -58,13 +58,17 @@ export const CensorPlugin = zeppelinGuildPlugin<CensorPluginType>()({
|
|||
configSchema: ConfigSchema,
|
||||
defaultOptions,
|
||||
|
||||
afterLoad(pluginData) {
|
||||
beforeLoad(pluginData) {
|
||||
const { state, guild } = pluginData;
|
||||
|
||||
state.serverLogs = new GuildLogs(guild.id);
|
||||
state.savedMessages = GuildSavedMessages.getGuildInstance(guild.id);
|
||||
|
||||
state.regexRunner = getRegExpRunner(`guild-${pluginData.guild.id}`);
|
||||
},
|
||||
|
||||
afterLoad(pluginData) {
|
||||
const { state, guild } = pluginData;
|
||||
|
||||
state.onMessageCreateFn = msg => onMessageCreate(pluginData, msg);
|
||||
state.savedMessages.events.on("create", state.onMessageCreateFn);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue