Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Discord = require('discord.js');
- const bot = new Discord.Client();
- const PREFIX = '-';
- bot.on('ready', () => {
- console.log("RoseTower-poll script is running")
- });
- bot.on('message', msg => {
- let args = msg.content.substring(PREFIX.length).split(" ");
- switch(args[0]) {
- case "poll":
- if (msg.member.roles.cache.has('748779039065636954') || msg.member.roles.cache.has('753851175127744562') || msg.member.roles.cache.has('754867996345892936') || msg.member.roles.cache.has('763704615107559435') || msg.member.roles.cache.has('759424234425942077') || msg.member.roles.cache.has('753685091967828089')){
- const Embed = new Discord.MessageEmbed()
- .setColor(0xFFC300)
- .setTitle("how to create a poll")
- .setDescription("say: '-poll {your question here}' to create a yes or no poll");
- if(!args[1]){
- msg.channel.send(Embed);
- break;
- }
- let msgArgs = args.slice(1).join(" ");
- msg.channel.send(":question: " + "**" + msgArgs + "**").then(messageReaction => {
- messageReaction.react("👍");
- messageReaction.react("👎");
- msg.delete()
- })
- break;
- } else {
- msg.channel.send('***__YOU DO NOT HAVE PERMISSIONS TO USE THAT COMMAND__***');
- }
- }
- })
- bot.login(process.env.token);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement