mrmBot-Matrix/commands/general/info.js

50 lines
1.7 KiB
JavaScript
Raw Normal View History

import { readFileSync } from "fs";
const { version } = JSON.parse(readFileSync(new URL("../../package.json", import.meta.url)));
import Command from "../../classes/command.js";
class InfoCommand extends Command {
async run() {
const owner = await this.ipc.fetchUser(process.env.OWNER);
2021-07-05 04:15:27 +00:00
const stats = await this.ipc.getStats();
return {
"embed": {
"color": 16711680,
"author": {
"name": "esmBot Info/Credits",
"icon_url": this.client.user.avatarURL
},
"description": `This instance is managed by **${owner.username}#${owner.discriminator}**.`,
"fields": [{
"name": " Version:",
"value": `v${version}${process.env.NODE_ENV === "development" ? "-dev" : ""}`
},
{
"name": "📝 Credits:",
"value": "Bot by **[Essem](https://essem.space)** and **[various contributors](https://github.com/esmBot/esmBot/graphs/contributors)**\nIcon by **[MintBorrow](https://mintborrow.newgrounds.com)**"
},
{
"name": "💬 Total Servers:",
"value": stats && stats.guilds ? stats.guilds : `${this.client.guilds.size} (for this cluster only)`
},
{
"name": "✅ Official Server:",
"value": "[Click here!](https://projectlounge.pw/support)"
},
{
"name": "💻 Source Code:",
"value": "[Click here!](https://github.com/esmBot/esmBot)"
},
{
"name": "🐦 Twitter:",
"value": "[Click here!](https://twitter.com/esmBot_)"
}
]
}
};
}
static description = "Gets some info and credits about me";
static aliases = ["botinfo", "credits"];
}
export default InfoCommand;