chore: Add initial configuration files and code structure

This commit is contained in:
Bildcraft1 2024-06-05 22:06:30 +02:00
commit 127a7dc87f
13 changed files with 1761 additions and 0 deletions

16
logs/logger.js Normal file
View file

@ -0,0 +1,16 @@
const fs = require('fs');
function logAction(action, userid, username) {
const date = new Date();
const formattedDate = `${date.getDate()}${date.getMonth() + 1}${date.getFullYear()}`;
const logMessage = `${new Date().toISOString()} ${action}\n`;
fs.appendFile(`./logs/${userid}_${username}_${formattedDate}.txt`, logMessage, (err) => {
if (err) {
console.error(`Failed to log action: ${err}`);
}
});
}
module.exports = {
logAction
};