Advertisement
dfhfjjfgjfsfeedgf

Untitled

Sep 25th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. const Discord = require("discord.js");
  2.  
  3. module.exports.run = async(bot, message, args) => {
  4.  
  5. if (message.member.hasPermission("ADMINISTRATOR")) {
  6. if(!message.member.hasPermission("ADMINISTRATOR"))
  7. return message.reply(`${message.author} You dont have permission to use this command`)
  8. message.delete()
  9. const text = args.join(" ")
  10. if (text.length < 1) return message.channel.send("Cannot announce nothing");
  11. const colour = args.slice(2).join(" ");
  12. let announceEmbed = new Discord.RichEmbed()
  13. .setTitle("Announcement")
  14. .setColor("#ff0000")
  15. .addField("Announced By", `${message.author}`)
  16. .setDescription(text);
  17. let announcechannel = message.guild.channels.find(`name`, "announcements");
  18. if(!announcechannel) return message.reply("Couldn't find channel");
  19. announcechannel.send(`@everyone`)
  20. announcechannel.send(announceEmbed);
  21.  
  22. }};
  23.  
  24. module.exports.help = {
  25. name: "announce"
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement