Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bot.on('message', message => {
- let args = message.content.substring(PREFIX.length).split(" ");
- switch(args[0]) {
- case "Poll":
- if(!message.member.roles.find(r => r.name === "Administrator" || r.name === "Admin")) return message.channel.send('You do not have permission to use this command.')
- const embed = new Discord.RichEmbed()
- .setAuthor("Wrong Usage (/Poll <question>)", "https://i.imgur.com/8lbNEaJ.png")
- .setColor(0x33B5FF)
- if (!args[1]) {
- message.channel.send(Embed);
- if (condition) return method();
- }
- message.channel.send(embed).then(messageReaction => {
- const embed = new Discord.RichEmbed()
- .setAuthor("Poll started")
- .setDescription(args.join(' '))
- .setFooter(`Poll created by: ${message.author.username}`,"https://i.imgur.com/8lbNEaJ.png")
- .setColor(0x33B5FF)
- messageReaction.react("👍")
- messageReaction.react("👎")
- message.channel.sendEmbed(embed);
- message.delete(5000).catch(console.error);
- });
- break;
- }
- });
- bot.login(token);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement