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…

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

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


Print Share Comment Cite Upload Translate Updates
APA

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/

MLA
" » Setting up Discord welcome message template." Deven | Sciencx - Wednesday February 10, 2021, https://www.scien.cx/2021/02/10/setting-up-discord-welcome-message-template/
HARVARD
Deven | Sciencx Wednesday February 10, 2021 » Setting up Discord welcome message template., viewed ,<https://www.scien.cx/2021/02/10/setting-up-discord-welcome-message-template/>
VANCOUVER
Deven | Sciencx - » Setting up Discord welcome message template. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/02/10/setting-up-discord-welcome-message-template/
CHICAGO
" » Setting up Discord welcome message template." Deven | Sciencx - Accessed . https://www.scien.cx/2021/02/10/setting-up-discord-welcome-message-template/
IEEE
" » Setting up Discord welcome message template." Deven | Sciencx [Online]. Available: https://www.scien.cx/2021/02/10/setting-up-discord-welcome-message-template/. [Accessed: ]
rf:citation
» Setting up Discord welcome message template | Deven | Sciencx | 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.

You must be logged in to translate posts. Please log in or register.