JaBa/commands/General/stats.js

53 lines
2.4 KiB
JavaScript
Raw Normal View History

2021-12-10 21:39:54 +05:00
const Command = require("../../base/Command.js"),
Discord = require("discord.js");
class Stats extends Command {
2021-12-26 19:29:37 +05:00
constructor(client) {
2021-12-10 21:39:54 +05:00
super(client, {
name: "stats",
dirname: __dirname,
enabled: true,
guildOnly: false,
aliases: [],
2021-12-10 21:39:54 +05:00
memberPermissions: [],
2021-12-26 19:29:37 +05:00
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
2021-12-10 21:39:54 +05:00
nsfw: false,
ownerOnly: false,
cooldown: 1000
2021-12-10 21:39:54 +05:00
});
}
2021-12-26 19:29:37 +05:00
async run(message, args, data) {
2021-12-10 21:39:54 +05:00
const statsEmbed = new Discord.MessageEmbed()
.setColor(data.config.embed.color)
.setFooter(data.config.embed.footer)
.setAuthor(message.translate("common:STATS"))
.setDescription(message.translate("general/stats:MADE"))
2021-12-26 19:29:37 +05:00
.addField(this.client.customEmojis.stats + " " + message.translate("general/stats:COUNTS_TITLE"), message.translate("general/stats:COUNTS_CONTENT", {
servers: this.client.guilds.cache.size,
users: this.client.users.cache.size
}), true)
2021-12-24 20:52:27 +05:00
.addField(this.client.customEmojis.version + " " + message.translate("general/stats:VERSIONS_TITLE"), `\`Discord.js : v${Discord.version}\`\n\`Nodejs : v${process.versions.node}\``, true)
.addField(this.client.customEmojis.ram + " " + message.translate("general/stats:RAM_TITLE"), `\`${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)}MB\``, true)
2021-12-26 19:29:37 +05:00
.addField(this.client.customEmojis.status.online + " " + message.translate("general/stats:ONLINE_TITLE"), message.translate("general/stats:ONLINE_CONTENT", {
time: message.convertTime(Date.now() + this.client.uptime, "from", true)
}))
.addField(this.client.customEmojis.voice + " " + message.translate("general/stats:MUSIC_TITLE"), message.translate("general/stats:MUSIC_CONTENT", {
2021-12-30 20:03:36 +05:00
count: this.client.player.voices.collection.size
2021-12-26 19:29:37 +05:00
}))
2021-12-10 21:39:54 +05:00
.addField(message.translate("general/stats:CREDITS_TITLE"), message.translate("general/stats:CREDITS_CONTENT", {
2021-12-26 19:29:37 +05:00
donators: [":("].join("\n"),
translators: ["`Jonny_Bro#4226` (:flag_ru:)", "`[ДАННЫЕ УДАЛЕНЫ]#2789` (:flag_ua:)", "`FaxoNfuckyou#9398` и `Jonny_Bro#4226` (:flag_us:)"].join("\n")
2021-12-10 21:39:54 +05:00
}));
2021-12-24 20:52:27 +05:00
statsEmbed.addField(this.client.customEmojis.link + " " + message.translate("general/stats:LINKS_TITLE"), message.translate("misc:STATS_FOOTER", {
dashboardLink: "https://jaba.pp.ua/",
docsLink: "https://jaba.pp.ua/docs/",
donateLink: "https://qiwi.com/n/JONNYBRO/",
owner: this.client.config.owner.id
2021-12-11 01:11:50 +05:00
}));
2021-12-10 21:39:54 +05:00
message.channel.send(statsEmbed);
}
2021-12-11 01:11:50 +05:00
};
2021-12-10 21:39:54 +05:00
2021-12-11 01:11:50 +05:00
module.exports = Stats;