Improve running the bot in a global context
This commit is contained in:
parent
3ffb7f4949
commit
57cd37d1eb
9 changed files with 24 additions and 15 deletions
|
@ -1,4 +1,6 @@
|
|||
import { readFileSync } from "fs";
|
||||
import { dirname } from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
const { version } = JSON.parse(readFileSync(new URL("../../package.json", import.meta.url)));
|
||||
import Command from "../../classes/command.js";
|
||||
import { exec as baseExec } from "child_process";
|
||||
|
@ -19,7 +21,7 @@ class InfoCommand extends Command {
|
|||
description: `This instance is managed by **${owner.username}#${owner.discriminator}**.`,
|
||||
fields: [{
|
||||
name: "ℹ️ Version:",
|
||||
value: `v${version}${process.env.NODE_ENV === "development" ? `-dev (${(await exec("git rev-parse HEAD")).stdout.substring(0, 7)})` : ""}`
|
||||
value: `v${version}${process.env.NODE_ENV === "development" ? `-dev (${(await exec("git rev-parse HEAD", { cwd: dirname(fileURLToPath(import.meta.url)) })).stdout.substring(0, 7)})` : ""}`
|
||||
},
|
||||
{
|
||||
name: "📝 Credits:",
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
import { readFileSync } from "fs";
|
||||
import { dirname } from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
const { version } = JSON.parse(readFileSync(new URL("../../package.json", import.meta.url)));
|
||||
import os from "os";
|
||||
import Command from "../../classes/command.js";
|
||||
|
@ -23,7 +25,7 @@ class StatsCommand extends Command {
|
|||
"color": 16711680,
|
||||
"fields": [{
|
||||
"name": "Version",
|
||||
"value": `v${version}${process.env.NODE_ENV === "development" ? `-dev (${(await exec("git rev-parse HEAD")).stdout.substring(0, 7)})` : ""}`
|
||||
"value": `v${version}${process.env.NODE_ENV === "development" ? `-dev (${(await exec("git rev-parse HEAD", { cwd: dirname(fileURLToPath(import.meta.url)) })).stdout.substring(0, 7)})` : ""}`
|
||||
},
|
||||
{
|
||||
"name": "Cluster Memory Usage",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue