From 2ab1375703e889e13339ddbb867ce13bf413d4d0 Mon Sep 17 00:00:00 2001 From: Vault108 <44564111+Vault108@users.noreply.github.com> Date: Thu, 11 Sep 2025 06:16:03 -0400 Subject: [PATCH 1/2] logging tweaks Signed-off-by: Vault108 <44564111+Vault108@users.noreply.github.com> --- DscSlash/stats.js | 8 ++------ index.js | 15 ++++++++++++--- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/DscSlash/stats.js b/DscSlash/stats.js index 2533ce5..7ddb769 100644 --- a/DscSlash/stats.js +++ b/DscSlash/stats.js @@ -2,12 +2,8 @@ const { SlashCommandBuilder, EmbedBuilder, version } = require("discord.js"); const { DurationFormatter } = require("@sapphire/time-utilities"); const durationFormatter = new DurationFormatter(); const packageinfo = require("../package.json"); -const name = packageinfo.name; const dversion = packageinfo.version; -const dependencies = packageinfo.dependencies; -console.log(`package name: ${name}`); -console.log(`package version: ${dversion}`); -console.log(`dependencies:`, dependencies); + const os = require('os'); module.exports = { @@ -34,4 +30,4 @@ module.exports = { await interaction.reply({ embeds: [statsEmbed] }); }, -}; \ No newline at end of file +}; diff --git a/index.js b/index.js index 4083363..5692249 100644 --- a/index.js +++ b/index.js @@ -16,9 +16,8 @@ const logger = require('./modules/Logger.js'); // This is your client. Some people call it `bot`, some people call it `self`, // some might call it `cootchie`. Either way, when you see `client.something`, // or `bot.something`, this is what we're referring to. Your client. +const packageinfo = require("../package.json"); const client = new Client({ intents, partials }); - - const slashcmds = new Collection(); const { UUID } = nmv; @@ -136,7 +135,17 @@ const init = async () => { // This logs a message to the console once the bot has successfully logged in. client.once(Events.ClientReady, c => { + const dversion = packageinfo.version; + const name = packageinfo.name; console.log(`Ready! Logged in as ${c.user.tag}`); + logger.log(`package name: ${name}`); + logger.log(`package version: ${dversion}`); + const pkg = require('./package.json'); + Object.entries(pkg.dependencies || {}).forEach(([dep, ver]) => { + logger.log(`dependency: ${dep}@${ver}`); + }); + + }); // This adds an error listener @@ -152,4 +161,4 @@ const init = async () => { // End top-level async/await function. }; -init(); \ No newline at end of file +init(); From 4712fe1ef876476de346f07c47ca04c595a71f29 Mon Sep 17 00:00:00 2001 From: Vault108 <44564111+Vault108@users.noreply.github.com> Date: Thu, 11 Sep 2025 08:27:42 -0400 Subject: [PATCH 2/2] Update index.js forgot to declare packageinfo --- index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/index.js b/index.js index 5692249..a936c8b 100644 --- a/index.js +++ b/index.js @@ -135,6 +135,7 @@ const init = async () => { // This logs a message to the console once the bot has successfully logged in. client.once(Events.ClientReady, c => { + const packageinfo = require("./package.json"); const dversion = packageinfo.version; const name = packageinfo.name; console.log(`Ready! Logged in as ${c.user.tag}`);