2020-07-29 00:28:04 +03:00
|
|
|
import { zeppelinPlugin } from "../ZeppelinPluginBlueprint";
|
|
|
|
import { CompanionChannelsPluginType, ConfigSchema, TCompanionChannelOpts } from "./types";
|
|
|
|
import { VoiceChannelJoinEvt } from "./events/VoiceChannelJoinEvt";
|
|
|
|
import { VoiceChannelSwitchEvt } from "./events/VoiceChannelSwitchEvt";
|
|
|
|
import { VoiceChannelLeaveEvt } from "./events/VoiceChannelLeaveEvt";
|
2020-07-30 13:08:06 +03:00
|
|
|
import { trimPluginDescription } from "../../utils";
|
2020-08-01 23:53:47 +03:00
|
|
|
import { LogsPlugin } from "../Logs/LogsPlugin";
|
|
|
|
import { CooldownManager } from "knub";
|
2020-07-29 00:28:04 +03:00
|
|
|
|
|
|
|
const defaultOptions = {
|
|
|
|
config: {
|
|
|
|
entries: {},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export const CompanionChannelsPlugin = zeppelinPlugin<CompanionChannelsPluginType>()("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.
|
|
|
|
`),
|
|
|
|
},
|
|
|
|
|
2020-08-01 23:53:47 +03:00
|
|
|
dependencies: [LogsPlugin],
|
2020-07-29 00:28:04 +03:00
|
|
|
configSchema: ConfigSchema,
|
|
|
|
defaultOptions,
|
|
|
|
|
|
|
|
events: [VoiceChannelJoinEvt, VoiceChannelSwitchEvt, VoiceChannelLeaveEvt],
|
2020-08-01 23:53:47 +03:00
|
|
|
|
|
|
|
onLoad(pluginData) {
|
|
|
|
pluginData.state.errorCooldownManager = new CooldownManager();
|
|
|
|
},
|
2020-07-29 00:28:04 +03:00
|
|
|
});
|