Remoed unused counting stuff

This commit is contained in:
2024-02-05 17:19:40 +01:00
parent b2420e949c
commit 477b60da26
2 changed files with 1 additions and 65 deletions

View File

@@ -1,7 +1,6 @@
import { ChannelType, PermissionFlagsBits, SlashCommandBuilder } from "discord.js" import { PermissionFlagsBits, SlashCommandBuilder } from "discord.js"
import { embedColor, devMessage } from "config/options" import { embedColor, devMessage } from "config/options"
import { Command } from "interfaces" import { Command } from "interfaces"
import setup from "./counting/setup"
import ban from "./counting/ban" import ban from "./counting/ban"
import unban from "./counting/unban" import unban from "./counting/unban"
@@ -15,18 +14,6 @@ export = {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("counting") .setName("counting")
.setDescription("counting subcommands") .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 => .addSubcommand(subcommand =>
subcommand subcommand
.setName("ban") .setName("ban")
@@ -55,11 +42,6 @@ export = {
async execute(interaction) { async execute(interaction) {
const subcommand = interaction.options.getSubcommand() const subcommand = interaction.options.getSubcommand()
if (subcommand === "setup") {
setup(interaction)
return
}
if (subcommand === "ban") { if (subcommand === "ban") {
ban(interaction) ban(interaction)
return return

View File

@@ -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<void> {
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
}
}]
})
}
}