module.exports = { name: "poll", category: "moderation", description: "Sends Poll Message..", usage: "", run: async (client, message, args) => { const fs = require('fs') if(!message.member.hasPermission(['MANAGE_MESSAGES'])) return message.reply("You Do Not Have Permission."); var messageArray = message.content.split(" "); const polltext = messageArray.join(" ").slice(6) if(polltext.length < 1) return message.reply("***Cannot Poll Nothing... Please Tell Me What To Poll.***"); let pollchannels = JSON.parse(fs.readFileSync("./pollchannel.json", "utf8")); if(!pollchannels[message.guild.id]) return("Cannot find poll channels in here!"); let pollChan = pollchannels[message.guild.id].pollchannel if (!pollChan) return message.channel.send("***❌Couln't FInd The Poll Channel. Make Sure You Set The Poll Channel***❌"); let pollerChannel = message.guild.channels.find(`name`, `${pollChan}`); var pollSent = await pollerChannel.send(`${polltext} || **[Ping: @here]**`); pollSent.react('✅') pollSent.react('❌') } }