updated command logging system to not spam my terminal

This commit is contained in:
ayeuhugyu 2023-09-13 07:03:46 -07:00
parent 92c9033d1e
commit d2f9b3efb2
2 changed files with 12 additions and 9 deletions

View file

@ -112,7 +112,8 @@ client.on("messageCreate", async (message) => {
"commands.log", "commands.log",
message, message,
__filename, __filename,
`use of command: ${command} by: ${message.author.username} (${message.author})"` `use of command: ${command} by: ${message.author.username} (${message.author})"`,
true
); );
client.commands.get(command).execute(message, args, client); client.commands.get(command).execute(message, args, client);
} }

View file

@ -1,6 +1,6 @@
const fs = require("fs"); const fs = require("fs");
module.exports.execute = function (file, message, from, msg) { module.exports.execute = function (file, message, from, msg, noconsole) {
fs.appendFileSync( fs.appendFileSync(
`../pepperbot/src/logs/${file}`, `../pepperbot/src/logs/${file}`,
`AT: ${Date()} `AT: ${Date()}
@ -9,13 +9,15 @@ FROM: ${message.content}
ADDITIONAL INFORMATION: ${msg} ADDITIONAL INFORMATION: ${msg}
\n` \n`
); );
console.log( if (!noconsole) {
`AT: ${Date()} console.log(
SCRIPT: ${from} `AT: ${Date()}
FROM: ${message.content} SCRIPT: ${from}
ADDITIONAL INFORMATION: ${msg} FROM: ${message.content}
` ADDITIONAL INFORMATION: ${msg}
); `
);
}
}; };
// TEMPLATE: // TEMPLATE: