Advertisement
Ryyan

Untitled

Jul 20th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. if (message.guild && message.content.startsWith('+dmall')) {//this command starts if the person says "+dmall", ofc you can change this to whatever you'd like.
  2.  
  3. let embed = new Discord.RichEmbed()
  4. .setColor("#ff0000")
  5. .setTitle(`❌${message.author.username}, error!❌`)
  6. .setDescription(`Invaild permissions.\n permissions needed: "MANAGE_ROLES", "ADMINISTRATOR"`)
  7. .setTimestamp()
  8.  
  9. if (!message.member.hasPermission(["MANAGE_ROLES", "ADMINISTRATOR"])) return message.channel.send(embed)//this then says you don't have permissions to do this. if they do have these permissions it will work.
  10.  
  11. let text = message.content.slice('/private'.length); // cuts off the +dmall part and create the text var.
  12. message.guild.members.forEach(member => {
  13. if (member.id != client.user.id && !member.user.bot) member.send(text);//gets every member in the server.
  14. });
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement