From edba188072d0393c50631cbc70c4ba8f8fae510e Mon Sep 17 00:00:00 2001 From: SileNce5k Date: Sun, 4 Jul 2021 20:41:55 +0200 Subject: [PATCH] Show correct amount of servers on botinfo command --- commands/botinfo.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/commands/botinfo.js b/commands/botinfo.js index 3b989cf..b49e15d 100644 --- a/commands/botinfo.js +++ b/commands/botinfo.js @@ -7,13 +7,18 @@ module.exports = { name: 'botinfo', description: 'Shows information about the bot', execute({message, client, prefix}) { + let guildCount = 0; + client.guilds.cache.each(guild => { + guildCount++ + }); + const embed = new Discord.MessageEmbed() .setColor(15780145) .setTitle("Information about bot") .setTimestamp() .setAuthor(client.user.username, client.user.avatarURL({ dynamic: true, size: 4096 })) .addFields({ - name: "General info", value: `Name: ${client.user.username}\nPrefix: ${prefix}\nTotal Servers: ${client.guilds.toString().length}\nCreation Date: ${getCreationDate(client.user)}\nSource: [Click Here](https://github.com/SileNce5k/discord_bot)`, + name: "General info", value: `Name: ${client.user.username}\nPrefix: ${prefix}\nTotal Servers: ${guildCount}\nCreation Date: ${getCreationDate(client)}\nSource: [Click Here](https://github.com/SileNce5k/discord_bot)`, },) message.channel.send(embed)