add lock , unlock , hide , unhide and version all , add sync commande

This commit is contained in:
VALOU3336
2024-02-27 10:05:39 +01:00
parent 8b3fcb6aa9
commit da89e5bd2f
12 changed files with 255 additions and 23 deletions
+22 -13
View File
@@ -12,20 +12,17 @@ module.exports = {
console.log('Connected to the SQLite database.');
});
// Wrap the serialize operations in a promise to use async/await
await new Promise((resolve, reject) => {
db.serialize(() => {
// Create the table if it doesn't exist
db.run('CREATE TABLE IF NOT EXISTS gestion (id TEXT PRIMARY KEY, value TEXT)', (err) => {
if (err) {
console.error(err.message);
reject(err);
} else {
console.log('Table gestion created or already exists.');
}
});
// Now that the table is guaranteed to exist, proceed with other operations
db.get('SELECT value FROM gestion WHERE id = ?', [client.user.id], (err, row) => {
if (err) {
console.error(err.message);
@@ -46,21 +43,33 @@ module.exports = {
reject(err);
} else {
console.log(`Les permissions ont été chargées pour le bot ${client.user.tag}`);
resolve(); // Resolve the promise once all operations are complete
resolve();
}
});
}
});
});
});
client.snipes = new Map();
console.log(`Le bot ${client.user.tag} est en ligne`);
process.on('uncaughtException', (error) => {
console.error('Uncaught Exception:', error);
});
process.on('unhandledRejection', (reason, promise) => {
console.error('Unhandled Rejection at:', promise, 'reason:', reason);
});
process.on('unhandledRejection', (reason, p) => {
console.log(' [antiCrash] :: Unhandled Rejection/Catch');
console.log(reason, p);
});
process.on('uncaughtException', (err, origin) => {
console.log(' [antiCrash] :: Uncaught Exception/Catch');
console.log(err, origin);
});
process.on('uncaughtExceptionMonitor', (err, origin) => {
console.log(' [antiCrash] :: Uncaught Exception/Catch (MONITOR)');
console.log(err, origin);
});
process.on('multipleResolves', (type, promise, reason) => {
console.log(' [antiCrash] :: Multiple Resolves');
console.log(type, promise, reason);
});
},
};