2022-12-13 08:02:29 +00:00
|
|
|
const Command = require('../../base/Command.js');
|
2022-12-17 09:58:25 +00:00
|
|
|
const { version, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require('discord.js');
|
2022-12-13 08:02:29 +00:00
|
|
|
const moment = require('moment');
|
|
|
|
require('moment-duration-format');
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = class About extends Command {
|
|
|
|
constructor (name, category) {
|
|
|
|
super (name, category);
|
|
|
|
this.name = name,
|
|
|
|
this.description = 'Bot information and statistics',
|
|
|
|
this.category = category,
|
|
|
|
this.usage = '/about';
|
|
|
|
}
|
|
|
|
|
|
|
|
async run (client, interaction, data) { //eslint-disable-line no-unused-vars
|
|
|
|
const uptime = moment.duration(client.uptime).format(' D [days], H [hrs], m [mins], s [secs]');
|
2022-12-17 09:58:25 +00:00
|
|
|
const bot = await interaction.guild.members.fetch(client.user.id, {force: true});
|
|
|
|
const userCount = await client.db.countUsers();
|
2022-12-13 08:02:29 +00:00
|
|
|
|
2022-12-17 09:58:25 +00:00
|
|
|
let build = 'prod';
|
2022-12-13 08:02:29 +00:00
|
|
|
if (client.config.developmentMode === true) {
|
2022-12-17 09:58:25 +00:00
|
|
|
build = 'dev';
|
2022-12-13 08:02:29 +00:00
|
|
|
}
|
|
|
|
|
2022-12-17 09:58:25 +00:00
|
|
|
const links = new ActionRowBuilder()
|
|
|
|
.addComponents(
|
|
|
|
new ButtonBuilder()
|
|
|
|
.setURL('https://discord.gg/HCF8mdv')
|
|
|
|
.setLabel('Support')
|
|
|
|
.setStyle(ButtonStyle.Link),
|
|
|
|
new ButtonBuilder()
|
|
|
|
.setURL('https://gitdab.com/embee/woomy')
|
|
|
|
.setLabel('Source')
|
|
|
|
.setStyle(ButtonStyle.Link),
|
|
|
|
);
|
|
|
|
|
2022-12-13 08:08:29 +00:00
|
|
|
const embed = new client.EmbedBuilder()
|
2022-12-17 09:58:25 +00:00
|
|
|
.setThumbnail(client.user.avatarURL({format: 'png'}))
|
|
|
|
.setColor(bot.user.hexAccentColor ?? bot.displayHexColor)
|
2022-12-13 08:02:29 +00:00
|
|
|
.setTitle('About me!')
|
|
|
|
.addFields([
|
|
|
|
{
|
|
|
|
name: 'General',
|
2022-12-17 09:58:25 +00:00
|
|
|
value: `• Users (approx): \`${userCount.rows[0].count.toString()}\`\n• Channels: \`${client.channels.cache.size}\`\n• Servers: \`${client.guilds.cache.size}\`\n• Commands: \`${client.commands.size}\`\n• Uptime: \`${uptime}\``,
|
2022-12-13 08:02:29 +00:00
|
|
|
inline: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Technical',
|
2022-12-17 09:58:25 +00:00
|
|
|
value: `• RAM Usage: \`${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)} MB\`\n• Host OS: \`${require('os').type}\`\n• Woomy version: \`v${client.version} ${build}\`\n• discord.js version: \`v${version}\`\n• node.js version: \`${process.version}\``,
|
2022-12-13 08:02:29 +00:00
|
|
|
inline: true
|
|
|
|
}
|
2022-12-13 08:08:29 +00:00
|
|
|
]);
|
2022-12-17 09:58:25 +00:00
|
|
|
return interaction.reply({ embeds: [embed], components: [links] });
|
2022-12-13 08:02:29 +00:00
|
|
|
}
|
|
|
|
};
|