mirror of
https://github.com/arthur-pbty/gestion.git
synced 2026-06-03 23:36:35 +02:00
add lock , unlock , hide , unhide and version all , add sync commande
This commit is contained in:
+22
-13
@@ -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);
|
||||
});
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user