Update v1.0.0-beta.12, addition of external APIs and optimization
Some checks failed
continuous-integration/drone/push Build was killed
continuous-integration/drone Build was killed

This commit is contained in:
2024-05-28 20:20:52 +02:00
parent b48abc756d
commit d76a781680
19 changed files with 742 additions and 169 deletions

View File

@@ -1,4 +1,17 @@
const { getUserData } = require('../Middlewares/watcherMiddleware');
const fs = require('fs').promises;
const path = require('path');
const filePath = path.join(__dirname, '../data/user.json');
async function getUserData() {
try {
const fileContent = await fs.readFile(filePath, 'utf8');
return JSON.parse(fileContent);
} catch (err) {
console.error(`Failed to read from ${filePath}: ${err}`);
throw err;
}
}
let userData = getUserData();
async function checkUserExistsDiscord(req, res, next) {