3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-19 07:20:00 +00:00
zeppelin/backend/src/plugins/CompanionChannels/CompanionChannelsPlugin.ts

41 lines
1.2 KiB
TypeScript
Raw Normal View History

import { CooldownManager } from "knub";
import { GuildLogs } from "../../data/GuildLogs";
2020-07-30 13:08:06 +03:00
import { trimPluginDescription } from "../../utils";
import { LogsPlugin } from "../Logs/LogsPlugin";
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
import { VoiceStateUpdateEvt } from "./events/VoiceStateUpdateEvt";
import { CompanionChannelsPluginType, ConfigSchema } from "./types";
2020-07-29 00:28:04 +03:00
const defaultOptions = {
config: {
entries: {},
},
};
export const CompanionChannelsPlugin = zeppelinGuildPlugin<CompanionChannelsPluginType>()({
name: "companion_channels",
2020-07-30 13:08:06 +03:00
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],
2020-07-29 00:28:04 +03:00
configSchema: ConfigSchema,
defaultOptions,
events: [VoiceStateUpdateEvt],
beforeLoad(pluginData) {
pluginData.state.errorCooldownManager = new CooldownManager();
},
afterLoad(pluginData) {
pluginData.state.serverLogs = new GuildLogs(pluginData.guild.id);
},
2020-07-29 00:28:04 +03:00
});