mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-14 10:44:55 -05:00
discord support
amogus is sus
This commit is contained in:
parent
62549de56c
commit
a70815513a
1 changed files with 16 additions and 0 deletions
|
@ -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] })
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue