This repository has been archived on 2024-01-30. You can view files and clone it, but cannot push or open issues or pull requests.
anitrox/commands/info.js

109 lines
4.0 KiB
JavaScript
Raw Normal View History

2021-01-19 14:02:09 -06:00
module.exports = {
name: 'info',
description: 'Shows bot and host information',
execute(client, message, args) {
function Uptime(uptimetype) {
let totalSeconds = (uptimetype / 1000);
let days = parseInt(Math.floor(totalSeconds / 86400)) + " day";
let hours = Math.floor(parseInt(Math.floor(totalSeconds / 3600)) % 24) + " hour";
totalSeconds %= 3600;
let minutes = parseInt(Math.floor(totalSeconds / 60)) + " minute";
let seconds = parseInt(totalSeconds % 60) + " second";
if (parseInt(days.substring(0,2)) != 1) days += "s";
if (parseInt(hours.substring(0,3)) != 1) hours += "s";
if (parseInt(minutes.substring(0,3)) != 1) minutes += "s";
if (parseInt(seconds.substring(0,3)) != 1) seconds += "s";
let uptime = `${days}**, **${hours}**, **${minutes}**, **${seconds}`;
return uptime;
};
2021-01-19 21:37:55 -06:00
const version = ("Public Test Release 2")
const release = ("anitrox_ptb")
2021-01-19 14:02:09 -06:00
const os = require("os")
const embed = {
2021-01-19 21:28:23 -06:00
"title": "<:NyabotInfo:697145463350231040> Information about Anitrox",
"description": "Everything you've ever wanted to know about Anitrox!",
2021-01-19 14:02:09 -06:00
"color": 11038194,
"footer": {
"icon_url": "https://cdn.discordapp.com/attachments/549707869138714635/793524910172667964/Screenshot_26.png",
"text": "Made with ❤ in Illinois | Anitrox © IDeletedSystem64 2018-2021 "
},
"thumbnail": {
"url": "https://cdn.discordapp.com/attachments/549707869138714635/793524910172667964/Screenshot_26.png"
},
"fields": [
{
"name": "Bot Information",
"value": "** **"
},
{
"name": "Release Type",
"value": release
},
{
"name": "Release Version",
"value": version
},
{
"name": "Uptime",
"value": Uptime(client.uptime)
},
{
"name": "<:memory:793536677737136178> Bot Memory Usage",
"value": (Math.round(process.memoryUsage().heapUsed / 1024 / 1024 * 100) / 100) + " MiB" + ", Total Free Memory"
},
{
"name": "<:hostinfo:793529505263517747> Host Information",
"value": "** **"
},
{
"name": "<:hostinfo:793529505263517747> Host Uptime",
"value": Uptime(os.uptime() * 1000)
},
{
"name": "<:cpu:793672442056802354> CPU Type",
"value": process.arch
},
2021-01-19 16:30:11 -06:00
2021-01-19 14:02:09 -06:00
{
"name": "<:hostos:793866961675223090> OS Type",
"value": process.platform + " / " + os.version()
},
{
"name": "<:node:793537507018145813> Node.JS Version",
"value": process.version
},
{
"name": "<:Discord:793676263411679232> Discord API Ping",
"value": "tba" + " ms",
"inline": true
},
{
"name": "<:hostinfo:793529505263517747> Bot Ping",
"value": Math.round(client.ws.ping) + " ms",
"inline": true
},
{
"name": "<:NyabotInfo:697145463350231040> **Want more system information?**",
2021-01-19 21:28:23 -06:00
"value": "Run np!sysinfo for more detailed system information (Coming Soon™)"
2021-01-19 14:02:09 -06:00
},
{
"name": "<:usersuccess:793885338250641469> **Special Thanks To**",
2021-01-19 21:28:23 -06:00
"value": "@OfficialTCGMatt for providing help with development/n @chuu_shi Allowing me to host Anitrox on his server"
2021-01-19 14:02:09 -06:00
}
]
};
message.channel.send({ embed });
}
2021-01-19 21:37:55 -06:00
};