const Discord = require("discord.js") module.exports = { name: "lockdown", category: "owner", run: async (client, message, args) => { // start } const embed = new Discord.MessageEmbed() .setTitle("Confirmation!") .setDescription("Are You Sure You Want To Restart The Bot?") .setFooter("React!") .setColor("RANDOM") const msg = await message.channel.send(embed) const cancel = new Discord.MessageEmbed() .setTitle("Cancelled!") .setDescription("Command Cancelled.") .setColor("#FF0000") const yes = new Discord.MessageEmbed() .setTitle("Locking Channels...") .setDescription(":white_check_mark: | Locked!!!") .setColor("GREEN") await msg.react('✅') await msg.react('❌') const filter = (reaction, user) => (reaction.emoji.name === '❌' || reaction.emoji.name === '✅') && (user.id === message.author.id); msg.awaitReactions(filter, { max: 1 }) .then((collected) => { collected.map((emoji) => { switch (emoji._emoji.name) { case '✅': msg.edit(yes).then(() => channels.forEach(channel => { channel.updateOverwrite(message.guild.roles.everyone, { SEND_MESSAGES: false }).then(() => { channel.setName(channel.name += `🔒`) }) })) break; case '❌': msg.edit(cancel) break; } }) }) } }