updated command logging system to not spam my terminal
This commit is contained in:
parent
92c9033d1e
commit
d2f9b3efb2
2 changed files with 12 additions and 9 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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`
|
||||||
);
|
);
|
||||||
|
if (!noconsole) {
|
||||||
console.log(
|
console.log(
|
||||||
`AT: ${Date()}
|
`AT: ${Date()}
|
||||||
SCRIPT: ${from}
|
SCRIPT: ${from}
|
||||||
FROM: ${message.content}
|
FROM: ${message.content}
|
||||||
ADDITIONAL INFORMATION: ${msg}
|
ADDITIONAL INFORMATION: ${msg}
|
||||||
`
|
`
|
||||||
);
|
);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// TEMPLATE:
|
// TEMPLATE:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue