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:
parent
933635fcd0
commit
33c6ae2188
26 changed files with 218 additions and 169 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue