discord

Setting up Discord welcome message template


Discord welcome message template and JoinDiscordBot for your discord that allows you to put a welcome message on your discord server, the modification of the channel is done in the code index.js.

Our Index.js file contains the following code.

const Discord = require('discord.js');
const client = new Discord.Client();
var prefix = "YOUR_PREFIX";

client.login('YOUR_TOKEN');

client.on("ready", () => {
	console.log("[JblusCode] -> You have Enable");
	client.user.setGame("YOUR_SET_GAME");
});

/*Join*/
client.on('guildMemberAdd', member =>{
    let embed = new Discord.RichEmbed()
        .setDescription(':tada: **' + member.user.username + '** joined ' + member.guild.name)
        .setFooter('We are now ' + member.guild.memberCount)
    member.guild.channels.get('CHANNEL_ID').send(embed)
});

/*Quit*/
client.on('guildMemberRemove', member =>{
    let embed = new Discord.RichEmbed()
        .setDescription(':cry: **' + member.user.username + '** left ' + member.guild.name)
        .setFooter('We are now ' + member.guild.memberCount)
    member.guild.channels.get('CHANNEL_ID').send(embed)
 
});

Now follow the following steps to get it working.

  • open the index.js file
  • Change the prefix on line 3
  • Import the token of your bot on line 5
  • Edit SetGame on line 9
  • Import the id of the join channel on line 17
  • Import id of channel left on line 25
  • Save the file and close your text editor
  • Open the open.bat file now
  • Write in the console “node index.js”
  • Here is your bot and opened

using this Discord welcome message template You can now put a welcome message on your discord server.


Share on social media

//