This content originally appeared on CodeSource.io and was authored by Deven
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.
The post Setting up Discord welcome message template appeared first on CodeSource.io.
This content originally appeared on CodeSource.io and was authored by Deven
Deven | Sciencx (2021-02-10T19:13:38+00:00) Setting up Discord welcome message template. Retrieved from https://www.scien.cx/2021/02/10/setting-up-discord-welcome-message-template/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.