const Command = require("../../Base/Command.js"); const { MessageEmbed, Message } = require("discord.js"); const {siren} = require('../../utils/emojis.json') module.exports = class Lockdown extends Command { constructor (client) { super(client, { name: "isdankdown", aliases: ["dankdead"], description: "locks all dankmemer channels in this guild", permission: ['MANAGE_GUILD'], cooldown: "5", example: "ok isdankdown ", owner: false, }); } async run (message, args) { const me = this.client.user.id const role = message.mentions.roles.first() || message.guild.roles.cache.get(args[0]) || message.guild.roles.everyone //dankmemer channels const channels = [ "870567997922766868", "870568023403167804", "870568045008023572" ] //reason let reason = args.slice(2).join(' '); if (!reason) reason = 'Dankmemer has some issue atm check <#860421335444094976> for more information.'; if (reason.length > 500) reason = reason.slice(0, 500) + '...'; //prompt message.channel.send(`${siren} Are you sure you want to **Lock** all dankmemer channels? (y/n)`) const filter = _message => message.author.id === _message.author.id && ['y','n','yes','no'].includes(_message.content.toLowerCase()); const options = { max: 1, time: 30000, errors: ['time'] }; const proceed = await message.channel.awaitMessages(filter, options) .then(collected => ['y','yes'].includes(collected.first().content.toLowerCase()) ? true : false) .catch(() => false); if (!proceed){ return message.lineReplyNoMention(`ok I've cancelled that command!`); } //send-message in all channels for(let i=0; i eventually.`) .addField('Reason', reason) .setThumbnail('https://cdn.discordapp.com/emojis/853634098145132574.gif?v=1') channel.send(embed) } catch(err) { console.log(err); } } return message.channel.send('Locking channels').then(msg => msg.edit('Lockdown complete')) }} };