Discord bot Lockdown code not working

Greetings, my glitch name is oofin777 and I am having a problem with a lockdown code (Lock every channel)

const Discord = require(‘discord.js’)

module.exports = {
config: {
name: “lockdown”,
description: “lock server”,
aliases:
},
run: async (bot, message, args) => {
let lockPermErr = new Discord.MessageEmbed()
.setTitle(“User Permission Error!”)
.setDescription(“Sorry, you don’t have permissions to use this! :x:”)

    if(!message.channel.permissionsFor(message.member).has("BAN_MEMBERS") ) return message.channel.send(lockPermErr);

    const channels = message.guild.channels.cache.filter(ch => ch.type !== 'category');
    if (args[0] === 'on') {
        channels.forEach(channel => {
            channel.updateOverwrite(message.guild.roles.everyone, {
                SEND_MESSAGES: false
            })
        })
        
        let lockEmbed = new Discord.MessageEmbed()
            
            .setThumbnail(`https://media.giphy.com/media/JozO6wdFcC81VPO6RS/giphy.gif`)
            .setDescription(`**\n\nDone! Server Fully Locked! 🔒**`)
            .setColor('#2F3136')
        return message.channel.send(lockEmbed);

    } else if (args[0] === 'off') {
        channels.forEach(channel => {
            channel.updateOverwrite(message.guild.roles.everyone, {
                SEND_MESSAGES: true
            })
        })
        
        let lockEmbed2 = new Discord.MessageEmbed()
            .setColor('#2F3136')    
            .setThumbnail(`https://media.giphy.com/media/JozO6wdFcC81VPO6RS/giphy.gif`)
            .setDescription(`**\n\nDone! Server Fully Unlocked! 🔓**`)
        return message.channel.send(lockEmbed2)
    }
}

}

I get no error in logs for some reason…

may have no command prom open, regen client token

What are those?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.