thaldrin/DiscordModules/General/system.js

55 lines
1.7 KiB
JavaScript
Raw Normal View History

2019-12-27 05:06:50 +00:00
const Command = require("../../src/structures/Command");
const { MessageEmbed, version: DiscordVersion } = require("discord.js");
const { developers, contributors, source, color } = require("../../config");
const os = require("os");
const db = require("quick.db");
const Backend = new db.table("backend");
2019-11-10 08:42:09 +00:00
function format(seconds) {
2019-12-27 05:06:50 +00:00
function pad(s) {
return (s < 10 ? "0" : "") + s;
}
var hours = Math.floor(seconds / (60 * 60));
var minutes = Math.floor((seconds % (60 * 60)) / 60);
var seconds = Math.floor(seconds % 60);
2019-11-10 08:42:09 +00:00
2019-12-27 05:06:50 +00:00
return pad(hours) + "h " + pad(minutes) + "m " + pad(seconds) + "s";
2019-11-10 08:42:09 +00:00
}
module.exports = class Info extends Command {
2019-12-27 05:06:50 +00:00
constructor() {
super({
name: "system",
description: "Show System Info",
aliases: ["sys", "sysinfo"],
module: "General",
cooldown: 0,
guildOnly: false,
developerOnly: false
});
}
2019-11-10 08:42:09 +00:00
2019-12-27 05:06:50 +00:00
async command(ctx) {
let SystemEmbed = new MessageEmbed()
.setTitle(`${ctx.client.user.username} | v${ctx.vars.version}`)
.setColor(color)
.setDescription(
`Made by ${ctx.utils.format.bold(
ctx.client.users.find(user => user.id === "318044130796109825").tag
)}`
)
.addField("Language", "Javascript", true)
.addField("Library", `d.js - v${DiscordVersion}`, true)
.addField("Uptime", `${format(process.uptime())}`, true)
.addField("Node", `${process.version}`, true)
.addField("Servers", ctx.client.guilds.size, true)
.addField("Users", ctx.client.users.size, true)
.addField(
"Total sauce found",
ctx.db.backend.get("SourceFynnder.found"),
true
);
2019-11-10 08:42:09 +00:00
2019-12-27 05:06:50 +00:00
ctx.send(SystemEmbed);
}
2019-11-10 08:42:09 +00:00
};