companion_channels: handle errors gracefully

This commit is contained in:
Dragory 2020-08-01 23:53:47 +03:00
parent 57316b142a
commit ea069c5db3
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
3 changed files with 52 additions and 14 deletions

View file

@ -4,6 +4,8 @@ import { VoiceChannelJoinEvt } from "./events/VoiceChannelJoinEvt";
import { VoiceChannelSwitchEvt } from "./events/VoiceChannelSwitchEvt";
import { VoiceChannelLeaveEvt } from "./events/VoiceChannelLeaveEvt";
import { trimPluginDescription } from "../../utils";
import { LogsPlugin } from "../Logs/LogsPlugin";
import { CooldownManager } from "knub";
const defaultOptions = {
config: {
@ -22,8 +24,13 @@ export const CompanionChannelsPlugin = zeppelinPlugin<CompanionChannelsPluginTyp
`),
},
dependencies: [LogsPlugin],
configSchema: ConfigSchema,
defaultOptions,
events: [VoiceChannelJoinEvt, VoiceChannelSwitchEvt, VoiceChannelLeaveEvt],
onLoad(pluginData) {
pluginData.state.errorCooldownManager = new CooldownManager();
},
});