From 21e1eec5144b1b2c35dc82a8fc50a4fe72be8a5c Mon Sep 17 00:00:00 2001 From: Braeden Sowinski Date: Sat, 1 Jul 2023 18:51:57 -0700 Subject: [PATCH] reset channels --- commands/reset-channels.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 commands/reset-channels.js diff --git a/commands/reset-channels.js b/commands/reset-channels.js new file mode 100644 index 0000000..5b9cb2b --- /dev/null +++ b/commands/reset-channels.js @@ -0,0 +1,26 @@ +const { EmbedBuilder } = require('discord.js'); + +module.exports = { + name: "setchannel", + description: "Add channel to allowed channels", + usage: "[channel]", + permissions: { + channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"], + member: ["MANAGE_GUILD"], + }, + SlashCommand: { + /** + * + * @param {require("../structures/LinesPoliceCadBot")} client + * @param {import("discord.js").MessageCreate} message + * @param {string[]} args + * @param {*} param3 + */ + run: async (client, interaction, args, { GuildDB }) => { + client.dbo.collection("prefixes").updateOne({"server.serverID":interaction.guild.id},{set:{"server.allowedChannels":[]]},$set:{"server.hasCustomChannels":false}},function(err, res) { + if (err) throw err; + return interaction.send({ content: `Successfully reset channels..` }); + }); + }, + }, +} \ No newline at end of file