3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-21 16:55:03 +00:00

WIP ModActions

This commit is contained in:
Dragory 2020-07-23 00:37:33 +03:00
parent aef2b4f43a
commit b72a76b27e
25 changed files with 1162 additions and 6 deletions

View file

@ -0,0 +1,28 @@
import { PluginData } from "knub";
import { ModActionsPluginType } from "../types";
import { UserNotificationMethod } from "../../../utils";
import { TextChannel } from "eris";
export function getDefaultContactMethods(
pluginData: PluginData<ModActionsPluginType>,
type: "warn" | "kick" | "ban",
): UserNotificationMethod[] {
const methods: UserNotificationMethod[] = [];
const config = pluginData.config.get();
if (config[`dm_on_${type}`]) {
methods.push({ type: "dm" });
}
if (config[`message_on_${type}`] && config.message_channel) {
const channel = pluginData.guild.channels.get(config.message_channel);
if (channel instanceof TextChannel) {
methods.push({
type: "channel",
channel,
});
}
}
return methods;
}