diff --git a/commands/serverinfo.js b/commands/serverinfo.js index 8990268..31d094c 100644 --- a/commands/serverinfo.js +++ b/commands/serverinfo.js @@ -1,6 +1,7 @@ const os = require('os') const path = require('path') const fs = require('fs/promises') +const { EmbedBuilder } = require('discord.js') // should i move this to util? async function getCpuModelName () { @@ -46,5 +47,20 @@ module.exports = { component.push({ text: 'Available memory usage: ', color: 'gold' }) component.push({ text: `${Math.floor(os.freemem() / 1024 / 1024)} MB`, color: 'aqua' }) bot.tellraw(selector, component) + }, + discordExecute: async function (bot, username, sender, prefix, args, channeldc, message, config) { + const Embed = new EmbedBuilder() + .setColor(config.discord.embedsColors.normal) + .setTitle('Server Info') + .setDescription(`Hostname: \`${os.hostname()}\` + Working directory: \`${path.join(__dirname, '..')}\` + OS architecture: \`${os.arch()}\` + OS platform: \`${os.platform()}\` + OS name: \`${os.version()}\` + CPU cores: \`${os.cpus().length()}\` + CPU model: \`${await getCpuModelName()}\` + Total memory usage: \`${Math.floor(os.totalmem() / 1024 / 1024)} MB\` + Available memory usage: \`${Math.floor(os.freemem() / 1024 / 1024)} MB\``) + channeldc.send({ embeds: [Embed] }) } }