From 0c2f84e013558eec660f3693eee96249386b0482 Mon Sep 17 00:00:00 2001 From: Kieran Date: Sat, 27 Aug 2022 21:23:48 +0100 Subject: [PATCH] Add scb to Unlock --- commands/admin/unlock.js | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/commands/admin/unlock.js b/commands/admin/unlock.js index 813c0d8..41e330f 100644 --- a/commands/admin/unlock.js +++ b/commands/admin/unlock.js @@ -1,20 +1,25 @@ -const { Client, Message, Permissions } = require('discord.js'); +const { Client, CommandInteraction, Permissions } = require("discord.js"); +const { SlashCommandBuilder } = require('@discordjs/builders'); +const { PermissionFlagsBits } = require('discord-api-types/v10'); + module.exports = { - name: 'unlock', - aliases: [''], - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args + ...new SlashCommandBuilder() + .setName('unlock') + .setDescription('Unlock a channel') + .setDefaultMemberPermissions(PermissionFlagsBits.KickMembers | PermissionFlagsBits.BanMembers), + /** + * + * @param {Client} client + * @param {CommandInteraction} interaction + * @param {String[]} args */ - run: async(client, message, args) => { + run: async (client, interaction, args) => { - const permission = message.member.permissions.has(Permissions.FLAGS.MANAGE_CHANNELS) - if (!permission)return message.reply({ contents: "You don't have permission to use this command" }); - - message.channel.permissionOverwrites.edit(message.guild.roles.everyone.id, {SEND_MESSAGES: true}); + const permission = interaction.member.permissions.has(Permissions.FLAGS.MANAGE_CHANNELS) + if (!permission)return interaction.reply({ contents: "You don't have permission to use this command", ephemeral: true }); + interaction.channel.permissionOverwrites.edit(interaction.guild.roles.everyone.id, {SEND_MESSAGES: true}); + interaction.reply("Channel has been unlocked.") - message.channel.send("Channel has been unlocked.") - } -} \ No newline at end of file + }, +}; \ No newline at end of file