Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Discord = require('discord.js');
- const bot = new Discord.Client();
- const token = 'Ihavethistoken';
- const prefix = '%';
- bot.on('ready', () => {
- console.log('Bot is online!');
- })
- bot.on("message", message => {
- if(message.author.bot) return
- const args = message.content.slice(prefix.length).trim().split(/ +/g);
- const command = args.shift().toLowerCase();
- if(command === 'embed'){
- const Embed = new Discord.RichEmbed()
- .setColor(0x00FFFF)
- .setTitle('Test Embed')
- .setDescription('Test Embed Description')
- .setAuthor(message.author.username)
- .addField('Field', 'This is field text!')
- .setFooter('Embed Test!')
- .setThumbnail(message.author.avatarURL)
- .setTimestamp()
- try{
- message.author.sendEmbed(Embed)
- } catch {
- message.reply('Unable to message you, make sure to turn DMs on!')
- }
- }
- })
- bot.login(token);
Advertisement
Add Comment
Please, Sign In to add comment