Update v1.0.0-beta.12, addition of external APIs and optimization
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user