Skip to content

Commit

Permalink
🔖 3.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusOtter committed Dec 14, 2022
1 parent 4c28360 commit 85f7903
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "discord-needle",
"version": "3.1.0",
"version": "3.2.0",
"description": "Needle is a discord bot that helps you manage your discord threads.",
"main": "./dist/index.js",
"type": "module",
Expand Down
7 changes: 5 additions & 2 deletions src/commands/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,20 @@ export default class InfoCommand extends NeedleCommand {
const cpuPercent = this.infoService.getCpuUsagePercent();
const ramPercent = this.infoService.getRamUsagePercent();
const freeRamMb = this.infoService.getFreeRamInMb();
const version = process.env.npm_package_version ?? "Unknown";
const version = process.env.npm_package_version;

let fields = [
{ name: "Servers", value: codeBlock(serverCount), inline: true },
{ name: "Users", value: codeBlock(userCount), inline: true },
{ name: "Largest server", value: codeBlock(largestServer), inline: true },
{ name: "Ping", value: codeBlock(ping), inline: true },
{ name: "Uptime", value: codeBlock(uptime), inline: true },
{ name: "Version", value: codeBlock(version), inline: true },
];

if (version) {
fields.push({ name: "Version", value: codeBlock(version), inline: true });
}

if (isOwner) {
fields = fields.concat([
{ name: "CPU usage", value: codeBlock(cpuPercent + "%"), inline: true },
Expand Down

0 comments on commit 85f7903

Please sign in to comment.