Add total members to botinfo command
All checks were successful
CI / CI (push) Successful in 1m22s

This commit is contained in:
SileNce5k 2025-05-08 17:37:05 +02:00
parent 7053495f40
commit 28d1f6d0a2
Signed by: SileNce
GPG key ID: B0A142BB4291B204
5 changed files with 30 additions and 17 deletions

View file

@ -1,6 +1,6 @@
const {EmbedBuilder} = require('discord.js');
const getCreationDate = require('../../util/getCreationDate');
const getGuildCount = require('../../util/getGuildCount');
const getGuildInfo = require('../../util/getGuildInfo');
@ -8,15 +8,27 @@ module.exports = {
name: 'botinfo',
description: 'Shows information about the bot',
execute({message, client, prefix}) {
let guildCount = getGuildCount(client)
let guildInfo = getGuildInfo(client)
let descriptionArr = [`Name: ${client.user.username}`,
`Prefix: ${prefix}`,
`Total Servers: ${guildInfo.guildCount}`,
`Total Members: ${guildInfo.totalMembers}`,
`Total Commands: ${client.commands.size}`,
`Creation Date: ${getCreationDate(client)}`,
`Source [Click Here](https://github.com/SileNce5k/discord_bot)`
]
let description = "";
descriptionArr.forEach(desc => {
description += `${desc}\n`;
})
const embed = new EmbedBuilder()
.setColor(15780145)
.setTitle("Information about bot")
.setTimestamp()
.setAuthor({name: client.user.username, iconURL: client.user.avatarURL({ format: 'png', dynamic: true, size: 2048 })})
.addFields({
name: "General info", value: `Name: ${client.user.username}\nPrefix: ${prefix}\nTotal Servers: ${guildCount}\nTotal Commands: ${client.commands.size}\nCreation Date: ${getCreationDate(client)}\nSource: [Click Here](https://github.com/SileNce5k/discord_bot)`,
},)
.setDescription(description)
message.channel.send({embeds :[embed]})