const { SlashCommandBuilder } = require('discord.js'); const { getFirestore } = require('firebase-admin/firestore'); module.exports = { data: new SlashCommandBuilder() .setName("deactivate") .setDescription("Deactivates counting"), async execute(interaction) { const db = getFirestore(); const channel = interaction.channelId; const id = `${interaction.guildId}-${channel}`; const doc = db.doc(`channels/${id}`); const exists = (await doc.get()).exists; if (exists) { await doc.delete(); await interaction.reply(`Deactivated channel <#${channel}>.`); } } }