diff --git a/database/3.2.4/1732973911304-createAutoKickConfig/Down/01-AutoKickConfig.sql b/database/3.2.4/1732973911304-createAutoKickConfig/Down/01-AutoKickConfig.sql deleted file mode 100644 index 8412a02..0000000 --- a/database/3.2.4/1732973911304-createAutoKickConfig/Down/01-AutoKickConfig.sql +++ /dev/null @@ -1 +0,0 @@ -DROP TABLE auto_kick_config; diff --git a/database/3.2.4/1732973911304-createAutoKickConfig/Up/01-AutoKickConfig-Table.sql b/database/3.2.4/1732973911304-createAutoKickConfig/Up/01-AutoKickConfig-Table.sql deleted file mode 100644 index e7d377a..0000000 --- a/database/3.2.4/1732973911304-createAutoKickConfig/Up/01-AutoKickConfig-Table.sql +++ /dev/null @@ -1,10 +0,0 @@ -CREATE TABLE auto_kick_config ( - Id varchar(255) NOT NULL, - WhenCreated datetime NOT NULL, - WhenUpdated datetime NOT NULL, - ServerId varchar(255) NOT NULL, - RoleId varchar(255) NOT NULL, - KickTime int NOT NULL, - NoticeTime int NULL, - NoticeChannelId varchar(255) NULL -); diff --git a/database/3.2.4/1732973911304-createAutoKickConfig/Up/02-AutoKickConfig-Key.sql b/database/3.2.4/1732973911304-createAutoKickConfig/Up/02-AutoKickConfig-Key.sql deleted file mode 100644 index e3fec43..0000000 --- a/database/3.2.4/1732973911304-createAutoKickConfig/Up/02-AutoKickConfig-Key.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE auto_kick_config - ADD PRIMARY KEY (Id); diff --git a/src/commands/autokick.ts b/src/commands/autokick.ts deleted file mode 100644 index 09318b3..0000000 --- a/src/commands/autokick.ts +++ /dev/null @@ -1,54 +0,0 @@ -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) { - } -} diff --git a/src/database/entities/AutoKickConfig.ts b/src/database/entities/AutoKickConfig.ts deleted file mode 100644 index 1ee3625..0000000 --- a/src/database/entities/AutoKickConfig.ts +++ /dev/null @@ -1,50 +0,0 @@ -import {Column, Entity} from "typeorm"; -import AppDataSource from "../dataSources/appDataSource"; -import BaseEntity from "../../contracts/BaseEntity"; - -@Entity() -export default class AutoKickConfig extends BaseEntity { - constructor(serverId: string, roleId: string, kickTime: number, noticeTime?: number, noticeChannelId?: string) { - super(); - - this.ServerId = serverId; - this.RoleId = roleId; - this.KickTime = kickTime; - this.NoticeTime = noticeTime; - this.NoticeChannelId = noticeChannelId; - } - - @Column() - ServerId: string; - - @Column() - RoleId: string; - - @Column({ type: "int" }) - KickTime: number; - - @Column({ type: "int", nullable: true }) - NoticeTime?: number; - - @Column({ nullable: true }) - NoticeChannelId?: string; - - public UpdateBasicDetails(roleId: string, kickTime: number, noticeTime?: number, noticeChannelId?: string) { - this.RoleId = roleId; - this.KickTime = kickTime; - this.NoticeTime = noticeTime; - this.NoticeChannelId = noticeChannelId; - } - - public static async FetchOneByServerIdAndRoleId(serverId: string, roleId: string): Promise { - const repository = AppDataSource.getRepository(AutoKickConfig); - - const query = repository - .createQueryBuilder("config") - .where("config.serverId = :serverId", { serverId }) - .andWhere("config.roleId = :roleId", { roleId }) - .getOne(); - - return query; - } -} diff --git a/src/database/migrations/3.2.4/1732973911304-createAutoKickConfig.ts b/src/database/migrations/3.2.4/1732973911304-createAutoKickConfig.ts deleted file mode 100644 index c4e9a74..0000000 --- a/src/database/migrations/3.2.4/1732973911304-createAutoKickConfig.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; -import MigrationHelper from "../../../helpers/MigrationHelper"; - -export class CreateAutoKickConfig1732973911304 implements MigrationInterface { - - public async up(queryRunner: QueryRunner): Promise { - MigrationHelper.Up("1732973911304-createAutoKickConfig", "3.2.4", [ - "01-AutoKickConfig-Table", - "02-AutoKickConfig-Key", - ], queryRunner) - } - - public async down(queryRunner: QueryRunner): Promise { - MigrationHelper.Down("1732973911304-createAutoKickConfig", "3.2.4", [ - "01-AutoKickConfig", - ], queryRunner) - } - -}