import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint"; import { CompanionChannelsPluginType, ConfigSchema } from "./types"; import { trimPluginDescription } from "../../utils"; import { LogsPlugin } from "../Logs/LogsPlugin"; import { CooldownManager } from "knub"; import { VoiceStateUpdateEvt } from "./events/VoiceStateUpdateEvt"; const defaultOptions = { config: { entries: {}, }, }; export const CompanionChannelsPlugin = zeppelinGuildPlugin()({ name: "companion_channels", showInDocs: true, info: { prettyName: "Companion channels", description: trimPluginDescription(` Set up 'companion channels' between text and voice channels. Once set up, any time a user joins one of the specified voice channels, they'll get channel permissions applied to them for the text channels. `), }, dependencies: [LogsPlugin], configSchema: ConfigSchema, defaultOptions, events: [VoiceStateUpdateEvt], beforeLoad(pluginData) { pluginData.state.errorCooldownManager = new CooldownManager(); }, });