Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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.
- let embed = new Discord.RichEmbed()
- .setColor("#ff0000")
- .setTitle(`❌${message.author.username}, error!❌`)
- .setDescription(`Invaild permissions.\n permissions needed: "MANAGE_ROLES", "ADMINISTRATOR"`)
- .setTimestamp()
- 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.
- let text = message.content.slice('-dmall'.length); // cuts off the +dmall part and create the text var.
- message.guild.members.forEach(member => {
- if (member.id != client.user.id && !member.user.bot) member.send(text);//gets every member in the server.
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement