discord support

amogus is sus
This commit is contained in:
ChomeNS 2023-01-23 17:50:44 +07:00
parent 62549de56c
commit a70815513a

View file

@ -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] })
}
}