mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-25 18:25:03 +00:00
fix: fix errors when unloading certain plugins after beforeLoad but before afterLoad
This commit is contained in:
parent
922c4ff871
commit
4fd5013a28
5 changed files with 22 additions and 10 deletions
|
@ -212,8 +212,10 @@ export const CountersPlugin = zeppelinGuildPlugin<CountersPluginType>()({
|
|||
},
|
||||
|
||||
beforeUnload(pluginData) {
|
||||
for (const interval of pluginData.state.decayTimers) {
|
||||
clearInterval(interval);
|
||||
if (pluginData.state.decayTimers) {
|
||||
for (const interval of pluginData.state.decayTimers) {
|
||||
clearInterval(interval);
|
||||
}
|
||||
}
|
||||
|
||||
pluginData.state.events.removeAllListeners();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue