From 477b60da2678052f7361334131a5f8f8b23e8a43 Mon Sep 17 00:00:00 2001 From: Taken Date: Mon, 5 Feb 2024 17:19:40 +0100 Subject: [PATCH] Remoed unused counting stuff --- src/commands/counting.ts | 20 +-------------- src/commands/counting/setup.ts | 46 ---------------------------------- 2 files changed, 1 insertion(+), 65 deletions(-) delete mode 100644 src/commands/counting/setup.ts diff --git a/src/commands/counting.ts b/src/commands/counting.ts index 9fd6bd9..d42d434 100644 --- a/src/commands/counting.ts +++ b/src/commands/counting.ts @@ -1,7 +1,6 @@ -import { ChannelType, PermissionFlagsBits, SlashCommandBuilder } from "discord.js" +import { PermissionFlagsBits, SlashCommandBuilder } from "discord.js" import { embedColor, devMessage } from "config/options" import { Command } from "interfaces" -import setup from "./counting/setup" import ban from "./counting/ban" import unban from "./counting/unban" @@ -15,18 +14,6 @@ export = { data: new SlashCommandBuilder() .setName("counting") .setDescription("counting subcommands") - .addSubcommand(subcommand => - subcommand - .setName("setup") - .setDescription("Setup counting channel") - .addChannelOption(option => - option - .setName("channel") - .setDescription("The channel to setup counting in") - .setRequired(true) - .addChannelTypes(ChannelType.GuildText, ChannelType.GuildAnnouncement) - ) - ) .addSubcommand(subcommand => subcommand .setName("ban") @@ -55,11 +42,6 @@ export = { async execute(interaction) { const subcommand = interaction.options.getSubcommand() - if (subcommand === "setup") { - setup(interaction) - return - } - if (subcommand === "ban") { ban(interaction) return diff --git a/src/commands/counting/setup.ts b/src/commands/counting/setup.ts deleted file mode 100644 index 6376a2c..0000000 --- a/src/commands/counting/setup.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { ChatInputCommandInteraction, TextChannel, channelMention } from "discord.js" -import settingsSchema from "schemas/settingsSchema" -import { embedColor, devMessage } from "config/options" -import mongoose from "mongoose" - -export default async function setup(interaction: ChatInputCommandInteraction): Promise { - await interaction.deferReply() - - const channel = interaction.options.getChannel("channel") as TextChannel - - if (await settingsSchema.findOne({ name: "counting" })) { - await settingsSchema.findOneAndUpdate( - { name: "counting" }, - { name: "counting", channel: channel.id } - ) - await interaction.editReply({ - embeds: [{ - description: "Counting channel has been updated to " + channelMention(channel.id), - color: embedColor, - footer: { - icon_url: interaction.guild!.iconURL() || undefined, - text: interaction.guild!.name + " | " + devMessage - } - }] - }) - } else { - const counting = new settingsSchema({ - _id: new mongoose.Types.ObjectId(), - name: "counting", - value: channel.id - }) - - await counting.save() - - await interaction.editReply({ - embeds: [{ - description: "Counting channel has been set to " + channelMention(channel.id), - color: embedColor, - footer: { - icon_url: interaction.guild!.iconURL() || undefined, - text: interaction.guild!.name + " | " + devMessage - } - }] - }) - } -}