Advertisement
Guest User

Untitled

a guest
Jan 28th, 2020
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  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. const client = new Discord.Client()
  10. Client.on('guildMemberAdd', member => {
  11. const channel = member.guild.channels.find(ch => ch.name === 'welcome')
  12. // Change 'Channel-Name' to whatever channel you want the welcome message to be in!
  13. const embed = new RichEmbed()
  14. //This is where you start writing your embed, I will include as many features as I can in this!
  15. .setAuthor("Welcome Bot")
  16. .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*"
  17. .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)
  18. .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
  19. .setURL()//When you have this set, You can click on the .setTitle & it will take you to the link set!
  20. .setImage('')
  21. //)//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..
  22. .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.
  23.  
  24. if (!channel) { return } else {//This is basically saying: If it finds ch.name
  25. channel.send({embed})//it will return with this embed
  26. }});
  27.  
  28. })
  29.  
  30. client.login(token);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement