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,6 +9,7 @@ FROM: ${message.content}
ADDITIONAL INFORMATION: ${msg} ADDITIONAL INFORMATION: ${msg}
\n` \n`
); );
if (!noconsole) {
console.log( console.log(
`AT: ${Date()} `AT: ${Date()}
SCRIPT: ${from} SCRIPT: ${from}
@ -16,6 +17,7 @@ FROM: ${message.content}
ADDITIONAL INFORMATION: ${msg} ADDITIONAL INFORMATION: ${msg}
` `
); );
}
}; };
// TEMPLATE: // TEMPLATE: