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",
message,
__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);
}

View file

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