Changed groups name and added some info about server

This commit is contained in:
unknown 2018-09-18 02:18:54 +02:00
parent 81c42a4d29
commit 329ce58dc9
2 changed files with 21 additions and 19 deletions

View file

@ -5,21 +5,23 @@ module.exports = class ServerCommand extends Command {
super(client, {
name: 'server',
group: 'utility',
guildOnly: 'true',
memberName: 'server',
description: 'very yes',
description: 'Show some stats about the server',
});
}
async run(message) {
const serverStatsEmbed = new Discord.RichEmbed()
.setColor('#0099ff')
.setTitle('Stats of the server')
.setDescription('Some description here')
.setThumbnail(message.guild.iconURL)
.addField(`Member: **${message.guild.memberCount}** \n Channel: **${message.guild.channels}**`)
.addBlankField()
.setTimestamp()
const addEmbed = {
color: 0x0099ff,
title: 'Stats of the server',
thumbnail: {
url: `${message.guild.iconURL}`,
},
description: `Member: **${message.guild.memberCount}** \nChannel number: **${message.guild.channels.size}**\nGuild created at **${message.guild.createdAt}**\nOwner: **${message.guild.owner}**`,
timestamp: new Date(),
};
message.say(serverStatsEmbed);
message.say({ embed: addEmbed });
}
};

View file

@ -16,10 +16,10 @@ const client = new CommandoClient({
client.registry
.registerDefaultTypes()
.registerGroups([
['fun', 'Fun commands'],
['utility', 'Some useful commands'],
['admin', 'Commands to make admin life easier'],
['owner', 'Commands the owner can use to manage the bot'],
['fun', 'Fun'],
['utility', 'Utility'],
['admin', 'Admins'],
['owner', 'Owner'],
])
.registerDefaultGroups()
.registerDefaultCommands()
@ -40,27 +40,27 @@ client.registry
client.on("guildCreate", guild => {
console.log(`${guild.name}\n${guild.memberCount} users\nOwner: ${guild.owner}`);
const channel = client.channels.get('487766113292124160');
const exampleEmbed = {
const addEmbed = {
color: 0x008000,
title: 'Someone added the bot! :D YAY',
description: `${guild.name}\n${guild.memberCount} users\nOwner: ${guild.owner}`,
timestamp: new Date(),
};
channel.send({ embed: exampleEmbed });
channel.send({ embed: addEmbed });
})
// When bot get kicked from a guild send embeds with details about it.
client.on("guildDelete", guild => {
console.log(`***BOT KICKED***\n${guild.name}\n${guild.memberCount} users\nOwner: ${guild.owner}\n***BOT KICKED***`);
const channel = client.channels.get('487766113292124160');
const exampleEmbed = {
const kickEmbed = {
color: 0xFF0000,
title: 'Someone removed the bot :(',
description: `${guild.name}\n${guild.memberCount} users\nOwner: ${guild.owner}`,
timestamp: new Date(),
};
channel.send({ embed: exampleEmbed });
channel.send({ embed: kickEmbed });
})
// Auto respond to messages