Advertisement
Guest User

Untitled

a guest
Feb 28th, 2020
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. bot.on('message', message => {
  2. let args = message.content.substring(PREFIX.length).split(" ");
  3.  
  4. switch(args[0]) {
  5.  
  6. case "Poll":
  7. 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.')
  8.  
  9. const embed = new Discord.RichEmbed()
  10. .setAuthor("Wrong Usage (/Poll <question>)", "https://i.imgur.com/8lbNEaJ.png")
  11. .setColor(0x33B5FF)
  12.  
  13. if (!args[1]) {
  14. message.channel.send(Embed);
  15.  
  16. if (condition) return method();
  17. }
  18.  
  19. message.channel.send(embed).then(messageReaction => {
  20.  
  21. const embed = new Discord.RichEmbed()
  22. .setAuthor("Poll started")
  23. .setDescription(args.join(' '))
  24. .setFooter(`Poll created by: ${message.author.username}`,"https://i.imgur.com/8lbNEaJ.png")
  25. .setColor(0x33B5FF)
  26.  
  27. messageReaction.react("👍")
  28. messageReaction.react("👎")
  29.  
  30. message.channel.sendEmbed(embed);
  31.  
  32. message.delete(5000).catch(console.error);
  33. });
  34.  
  35. break;
  36. }
  37.  
  38. });
  39.  
  40. bot.login(token);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement