zappyzep/backend/src/plugins/Automod/commands/ViewAntiraidCmd.ts

18 lines
726 B
TypeScript

import { typedGuildCommand, GuildPluginData } from "knub";
import { AutomodPluginType } from "../types";
import { setAntiraidLevel } from "../functions/setAntiraidLevel";
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import { commandTypeHelpers as ct } from "../../../commandTypes";
export const ViewAntiraidCmd = typedGuildCommand<AutomodPluginType>()({
trigger: "antiraid",
permission: "can_view_antiraid",
async run({ pluginData, message }) {
if (pluginData.state.cachedAntiraidLevel) {
message.channel.createMessage(`Anti-raid is set to **${pluginData.state.cachedAntiraidLevel}**`);
} else {
message.channel.createMessage(`Anti-raid is **off**`);
}
},
});