Sir_Spaceboi

Embed Script JS

Sep 12th, 2020
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. const Discord = require('discord.js');
  2. const bot = new Discord.Client();
  3. const token = 'Ihavethistoken';
  4. const prefix = '%';
  5.  
  6. bot.on('ready', () => {
  7. console.log('Bot is online!');
  8. })
  9.  
  10. bot.on("message", message => {
  11. if(message.author.bot) return
  12.  
  13. const args = message.content.slice(prefix.length).trim().split(/ +/g);
  14. const command = args.shift().toLowerCase();
  15.  
  16. if(command === 'embed'){
  17. const Embed = new Discord.RichEmbed()
  18. .setColor(0x00FFFF)
  19. .setTitle('Test Embed')
  20. .setDescription('Test Embed Description')
  21. .setAuthor(message.author.username)
  22. .addField('Field', 'This is field text!')
  23. .setFooter('Embed Test!')
  24. .setThumbnail(message.author.avatarURL)
  25. .setTimestamp()
  26. try{
  27. message.author.sendEmbed(Embed)
  28. } catch {
  29. message.reply('Unable to message you, make sure to turn DMs on!')
  30. }
  31. }
  32. })
  33.  
  34. bot.login(token);
Advertisement
Add Comment
Please, Sign In to add comment