zappyzep/backend/src/plugins/ModActions/commands/SoftbanCommand.ts
2020-10-01 01:43:38 +03:00

35 lines
1.2 KiB
TypeScript

import { modActionsCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { trimPluginDescription } from "../../../utils";
import { actualKickMemberCmd } from "../functions/actualKickMemberCmd";
const opts = {
mod: ct.member({ option: true }),
notify: ct.string({ option: true }),
"notify-channel": ct.textChannel({ option: true }),
};
export const SoftbanCmd = modActionsCmd({
trigger: "softban",
permission: "can_kick",
description: trimPluginDescription(`
"Softban" the specified user by banning and immediately unbanning them. Effectively a kick with message deletions.
This command will be removed in the future, please use kick with the \`- clean\` argument instead
`),
signature: [
{
user: ct.string(),
reason: ct.string({ required: false, catchAll: true }),
...opts,
},
],
async run({ pluginData, message: msg, args }) {
await actualKickMemberCmd(pluginData, msg, { clean: true, ...args });
await msg.channel.createMessage(
"Softban will be removed in the future - please use the kick command with the `-clean` argument instead!",
);
},
});