From bc3c16bdcbb943d1e8b262f3adbd1c6a999fcf2b Mon Sep 17 00:00:00 2001 From: Ethan Lane Date: Sat, 30 Nov 2024 13:53:24 +0000 Subject: [PATCH] WIP: Start creating autokick command --- src/commands/autokick.ts | 54 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 src/commands/autokick.ts diff --git a/src/commands/autokick.ts b/src/commands/autokick.ts new file mode 100644 index 0000000..09318b3 --- /dev/null +++ b/src/commands/autokick.ts @@ -0,0 +1,54 @@ +import {CommandInteraction, PermissionFlagsBits, SlashCommandBuilder} from "discord.js"; +import {Command} from "../type/command"; + +export default class Autokick extends Command { + constructor() { + super(); + + this.CommandBuilder = new SlashCommandBuilder() + .setName("autokick") + .setDescription("Configure the auto kick functionality") + .setDefaultMemberPermissions(PermissionFlagsBits.KickMembers) + .addSubcommand(x => x + .setName("set") + .setDescription("Set the configuration") + .addRoleOption(y => y + .setName("role") + .setDescription("The role the user needs to be auto kicked") + .setRequired(true)) + .addStringOption(y => y + .setName("kicktime") + .setDescription("The time with the role before being kicked (Ex: 2h 30m)") + .setRequired(true)) + .addStringOption(y => y + .setName("noticetime") + .setDescription("The time before being kicked when a notification is sent (Ex: 2h 30m)")) + .addChannelOption(y => y + .setName("noticechannel") + .setDescription("The channel to send the notification to"))) + .addSubcommand(x => x + .setName("unset") + .setDescription("Unset the current configuration")); + } + + public override async execute(interaction: CommandInteraction) { + if (!interaction.isChatInputCommand()) return; + + const subcommand = interaction.options.getSubcommand(); + + switch (subcommand) { + case "set": + await this.set(interaction); + break; + case "unset": + await this.unset(interaction); + break; + } + } + + private async set(interaction: CommandInteraction) { + } + + private async unset(interaction: CommandInteraction) { + } +}