mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-15 05:41:51 +00:00
mutes: fix pluginData.state being initialized too late
This commit is contained in:
parent
f19e365bf6
commit
aa4ce00fa6
1 changed files with 3 additions and 1 deletions
|
@ -105,14 +105,16 @@ export const MutesPlugin = zeppelinGuildPlugin<MutesPluginType>()({
|
|||
},
|
||||
},
|
||||
|
||||
afterLoad(pluginData) {
|
||||
beforeLoad(pluginData) {
|
||||
pluginData.state.mutes = GuildMutes.getGuildInstance(pluginData.guild.id);
|
||||
pluginData.state.cases = GuildCases.getGuildInstance(pluginData.guild.id);
|
||||
pluginData.state.serverLogs = new GuildLogs(pluginData.guild.id);
|
||||
pluginData.state.archives = GuildArchives.getGuildInstance(pluginData.guild.id);
|
||||
|
||||
pluginData.state.events = new EventEmitter();
|
||||
},
|
||||
|
||||
afterLoad(pluginData) {
|
||||
// Check for expired mutes every 5s
|
||||
const firstCheckTime = Math.max(Date.now(), FIRST_CHECK_TIME) + FIRST_CHECK_INCREMENT;
|
||||
FIRST_CHECK_TIME = firstCheckTime;
|
||||
|
|
Loading…
Add table
Reference in a new issue