java script member count embed 1

java script member count embed

Const { MessageEmbed } = require('discord.js')
module.exports = { 
  name: 'stats',
	description: 'Display info about this server.',
	execute(message) {
       const embed = new MessageEmbed()
       .setColor('RANDOM')
       .setTitle(`Title Display Here`)
       .setDescription(`Member Count: ${message.guild.memberCount}`)
       .setFooter(`Member Count Command: Made By Paalua#2020 On Discord`)
       message.channel.send(embed)
    },
};

Here is what the above code is Doing:
1. We are requiring the discord.js module.
2. We are creating a new command called stats.
3. We are setting the description of the command to “Display info about this server.”
4. We are setting the execute function to display the member count of the server.
5. We are creating a new embed.
6. We are setting the color of the embed to random.
7. We are setting the title of the embed to “Title Display Here”.
8. We are setting the description of the embed to “Member Count: ${message.guild.memberCount}”.
9. We are setting the footer of the embed to “Member Count Command: Made By Paalua#2020 On Discord”.
10. We are sending the embed to the channel.

Now, let’s go over the code line by line.

1. We are requiring the discord.js module.

const { MessageEmbed } = require(‘discord.js’)

This is the same as:

const Discord = require(‘discord.js’)
const { MessageEmbed } = Discord

2. We are creating a new command called stats.

module.exports = {
name: ‘stats’,
description: ‘Display info about this server.’,
execute(message) {
const embed = new MessageEmbed()
.setColor(‘RANDOM’)
.setTitle(`Title Display Here`)
.setDescription(`Member Count: ${message.guild.memberCount}`)
.setFooter(`Member Count Command: Made By Paalua#2020 On Discord`)
message.channel.send(embed)
},
};

3. We are setting the description of the command to “Display info about this server.”

module.exports = {
name: ‘stats’,
description: ‘Display info about this server.’,
execute(message) {
const embed = new MessageEmbed()
.setColor(‘RANDOM’)
.setTitle(`Title Display Here`)
.setDescription(`Member Count: ${message.guild.memberCount}`)
.setFooter(`Member Count Command: Made By Paalua#2020 On Discord`)
message.channel.send(embed)
},
};

4. We are setting the execute function to display the member count of the server.

module.exports = {
name: ‘stats’,
description: ‘Display info about this server.’,
execute(message) {
const embed = new MessageEmbed()
.setColor(‘RANDOM’)
.setTitle(`Title Display Here`)
.setDescription(`Member Count: ${message.guild.memberCount}`)
.setFooter(`Member Count Command: Made By Paalua#2020 On Discord`)
message.channel.send(embed)
},
};

5. We are creating a new embed.

const embed = new MessageEmbed()

6. We are setting the color of the embed to random.

.setColor(‘RANDOM’)

7. We are setting the title of the embed to “Title Display Here”.

.setTitle(`Title Display Here`)

8. We are setting the description of the embed to “Member Count: ${message.guild.memberCount}”.

.setDescription(`Member Count: ${message.guild.memberCount}`)

9. We are setting the

Similar Posts