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

uniform before/after Load shorthands

Signed-off-by: GitHub <noreply@github.com>
This commit is contained in:
metal 2023-03-20 19:49:48 +00:00 committed by GitHub
parent 933635fcd0
commit 33c6ae2188
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 218 additions and 169 deletions

View file

@ -209,15 +209,19 @@ export const ModActionsPlugin = zeppelinGuildPlugin<ModActionsPluginType>()({
},
afterLoad(pluginData) {
pluginData.state.unregisterGuildEventListener = onGuildEvent(pluginData.guild.id, "expiredTempban", (tempban) =>
const { state, guild } = pluginData;
state.unregisterGuildEventListener = onGuildEvent(guild.id, "expiredTempban", (tempban) =>
clearTempban(pluginData, tempban),
);
},
beforeUnload(pluginData) {
pluginData.state.unloaded = true;
pluginData.state.unregisterGuildEventListener?.();
pluginData.state.events.removeAllListeners();
const { state, guild } = pluginData;
state.unloaded = true;
state.unregisterGuildEventListener?.();
state.events.removeAllListeners();
},
// FIXME: Proper inherittance from ZeppelinPluginBlueprint