Advertisement
Guest User

Untitled

a guest
Jan 28th, 2020
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const Discord = require('discord.js');
  2. const client = new Discord.Client();
  3.  
  4. const token = 'TOKEN';
  5.  
  6. client.on('ready', () =>{
  7. console.log('Discord Client is Online')
  8. }
  9. client.on('guildMemberAdd', member => {
  10. const channel = member.guild.channels.find(ch => ch.name === 'welcome')
  11. // Change 'Channel-Name' to whatever channel you want the welcome message to be in!
  12. const embed = new RichEmbed()
  13. //This is where you start writing your embed, I will include as many features as I can in this!
  14. .setAuthor("Welcome Bot")
  15. .setTitle(`Welcome to <name>, Official Discord, ${member.displayName}!`)//This will be the second line below .setAuthor, This will say "Welcome to *Server Name*, *Name of person who joined*"
  16. .setColor('#cc0000')//This is the color of the bar that is going to be on your embed, You only want to change the part after `0x`. The Colors are in Hex code. If I were to change it from the Coral Red to Teal i would change it from .setColor(0xF08080) to .setColor(0x008080)
  17. .setDescription(`Welcome to <server>, ${member.displayName}`)//This a gray box that would be like normal discord text, You can use the markup language like ```Message``` or ``Message``, ectetera
  18. .setURL()//When you have this set, You can click on the .setTitle & it will take you to the link set!
  19. .setImage('')
  20. //)//This is going to be the Image underneath the Embed, I'm going to be using an example image for this Embed, Give me a second to check my files..
  21. .addBlankField(true)//This line is a boolean so it's either ``true`` or ``false``, If you dont want the blank field, Just remove the line.
  22.  
  23. if (!channel) { return } else {//This is basically saying: If it finds ch.name
  24. channel.send({embed})//it will return with this embed
  25. }});
  26.  
  27. )
  28.  
  29. client.login(token);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement