diff options
Diffstat (limited to 'src/commands/info/botInfo.ts')
-rw-r--r-- | src/commands/info/botInfo.ts | 46 |
1 files changed, 25 insertions, 21 deletions
diff --git a/src/commands/info/botInfo.ts b/src/commands/info/botInfo.ts index 3aea3cd..d899a95 100644 --- a/src/commands/info/botInfo.ts +++ b/src/commands/info/botInfo.ts @@ -1,6 +1,6 @@ import { BushCommand, type BushMessage, type BushSlashMessage } from '#lib'; import assert from 'assert'; -import { MessageEmbed, Permissions, version as discordJSVersion } from 'discord.js'; +import { Embed, Permissions, version as discordJSVersion } from 'discord.js'; import * as os from 'os'; const { default: prettyBytes } = await import('pretty-bytes'); assert(prettyBytes); @@ -39,32 +39,36 @@ export default class BotInfoCommand extends BushCommand { const currentCommit = (await util.shell('git rev-parse HEAD')).stdout.replace('\n', ''); let repoUrl = (await util.shell('git remote get-url origin')).stdout.replace('\n', ''); if (repoUrl.includes('.git')) repoUrl = repoUrl.substring(0, repoUrl.length - 4); - const embed = new MessageEmbed() + const embed = new Embed() .setTitle('Bot Info:') - .addField('**Uptime**', util.humanizeDuration(client.uptime!, 2), true) - .addField( - '**Memory Usage**', - `System: ${prettyBytes(os.totalmem() - os.freemem(), { binary: true })}/${prettyBytes(os.totalmem(), { + .addField({ name: '**Uptime**', value: util.humanizeDuration(client.uptime!, 2), inline: true }) + .addField({ + name: '**Memory Usage**', + value: `System: ${prettyBytes(os.totalmem() - os.freemem(), { binary: true })}/${prettyBytes(os.totalmem(), { binary: true })}\nHeap: ${prettyBytes(process.memoryUsage().heapUsed, { binary: true })}/${prettyBytes( process.memoryUsage().heapTotal, { binary: true } )}`, - true - ) - .addField('**CPU Usage**', `${client.stats.cpu}%`, true) - .addField('**Platform**', Platform[process.platform], true) - .addField('**Commands Used**', `${client.stats.commandsUsed.toLocaleString()}`, true) - .addField('**Servers**', client.guilds.cache.size.toLocaleString(), true) - .addField('**Users**', client.users.cache.size.toLocaleString(), true) - .addField('**Discord.js Version**', discordJSVersion, true) - .addField('**Node.js Version**', process.version.slice(1), true) - .addField('**Commands**', client.commandHandler.modules.size.toLocaleString(), true) - .addField('**Listeners**', client.listenerHandler.modules.size.toLocaleString(), true) - .addField('**Inhibitors**', client.inhibitorHandler.modules.size.toLocaleString(), true) - .addField('**Tasks**', client.taskHandler.modules.size.toLocaleString(), true) - .addField('**Current Commit**', `[${currentCommit.substring(0, 7)}](${repoUrl}/commit/${currentCommit})`, true) - .addField('**Developers**', developers, true) + inline: true + }) + .addField({ name: '**CPU Usage**', value: `${client.stats.cpu}%`, inline: true }) + .addField({ name: '**Platform**', value: Platform[process.platform], inline: true }) + .addField({ name: '**Commands Used**', value: `${client.stats.commandsUsed.toLocaleString()}`, inline: true }) + .addField({ name: '**Servers**', value: client.guilds.cache.size.toLocaleString(), inline: true }) + .addField({ name: '**Users**', value: client.users.cache.size.toLocaleString(), inline: true }) + .addField({ name: '**Discord.js Version**', value: discordJSVersion, inline: true }) + .addField({ name: '**Node.js Version**', value: process.version.slice(1), inline: true }) + .addField({ name: '**Commands**', value: client.commandHandler.modules.size.toLocaleString(), inline: true }) + .addField({ name: '**Listeners**', value: client.listenerHandler.modules.size.toLocaleString(), inline: true }) + .addField({ name: '**Inhibitors**', value: client.inhibitorHandler.modules.size.toLocaleString(), inline: true }) + .addField({ name: '**Tasks**', value: client.taskHandler.modules.size.toLocaleString(), inline: true }) + .addField({ + name: '**Current Commit**', + value: `[${currentCommit.substring(0, 7)}](${repoUrl}/commit/${currentCommit})`, + inline: true + }) + .addField({ name: '**Developers**', value: developers, inline: true }) .setTimestamp() .setColor(util.colors.default); await message.util.reply({ embeds: [embed] }); |