Fixed stats

This commit is contained in:
Loïc Bersier 2018-09-09 00:22:05 +02:00
parent d3aa4c9a8c
commit 2912897e32
2 changed files with 7 additions and 7 deletions

View file

@ -10,6 +10,6 @@ module.exports = class MeowCommand extends Command {
} }
run(message) { run(message) {
return message.channel.send(`Servers: ${this.client.guilds.size}\nChannels: ${this.client.channels.size}\nUsers : ${this.client.users.size}`); return message.channel.send(`Servers: \`${this.client.guilds.size}\`\nChannels: \`${this.client.channels.size}\`\nUsers: \`${this.client.users.size}\`\nBot uptime: \`${this.client.uptime}\``);
} }
}; };

View file

@ -1,6 +1,6 @@
const { CommandoClient } = require('discord.js-commando'); const { CommandoClient } = require('discord.js-commando');
const path = require('path'); const path = require('path');
const { activity, token } = require('./config.json'); const { token } = require('./config.json');
const responseObject = require("./reply.json"); const responseObject = require("./reply.json");
const fs = require("fs"); const fs = require("fs");
@ -26,11 +26,11 @@ client.registry
client.on('ready', () => { client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}! (${client.user.id})`); console.log(`Logged in as ${client.user.tag}! (${client.user.id})`);
console.log(`Ready to serve in ${client.channels.size} channels on ${client.guilds.size} servers, for a total of ${client.users.size} users. ${client.readyAt}`); console.log(`Ready to serve in ${client.channels.size} channels on ${client.guilds.size} servers, for a total of ${client.users.size} users. ${client.readyAt}`);
client.user.setActivity(activity); // Send stats to the "stats" channel in the support server
const channel = client.channels.get('487766113292124160'); const channel = client.channels.get('487766113292124160');
channel.send(`Ready to serve in ${client.channels.size} channels on ${client.guilds.size} servers, for a total of ${client.users.size} users. ${client.readyAt}`); channel.send(`Ready to serve in ${client.channels.size} channels on ${client.guilds.size} servers, for a total of ${client.users.size} users. ${client.readyAt}`);
}); });
// when bot join a guild send embeds with detail about it // When bot join a guild send embeds with details about it.
client.on("guildCreate", guild => { client.on("guildCreate", guild => {
console.log(`${guild.name}\n${guild.memberCount} users\nOwner: ${guild.owner}`); console.log(`${guild.name}\n${guild.memberCount} users\nOwner: ${guild.owner}`);
const channel = client.channels.get('487766113292124160'); const channel = client.channels.get('487766113292124160');
@ -43,7 +43,7 @@ client.registry
channel.send({ embed: exampleEmbed }); channel.send({ embed: exampleEmbed });
}) })
// When bot get kicked from a guild send embeds with details about it.
client.on("guildDelete", guild => { client.on("guildDelete", guild => {
console.log(`***BOT KICKED***\n${guild.name}\n${guild.memberCount} users\nOwner: ${guild.owner}\n***BOT KICKED***`); console.log(`***BOT KICKED***\n${guild.name}\n${guild.memberCount} users\nOwner: ${guild.owner}\n***BOT KICKED***`);
const channel = client.channels.get('487766113292124160'); const channel = client.channels.get('487766113292124160');