add warn system with , warn , unwarn, and sanction command

This commit is contained in:
VALOU3336
2024-03-03 20:52:57 +01:00
parent 52da255455
commit 099a559169
4 changed files with 139 additions and 4 deletions
+15 -4
View File
@@ -15,7 +15,6 @@ module.exports = {
if (err) {
console.error(err.message);
}
console.log('Connected to the backups database.');
});
@@ -27,7 +26,6 @@ module.exports = {
console.error(err.message);
reject(err);
} else {
console.log('Table gestion created or already exists.');
}
});
@@ -36,7 +34,6 @@ module.exports = {
console.error(err.message);
reject(err);
} else {
console.log('Table prevname created or already exists.');
}
});
backupdb.run(`CREATE TABLE IF NOT EXISTS backups (
@@ -49,9 +46,23 @@ module.exports = {
console.error(err.message);
reject(err);
} else {
console.log('Table backups created or already exists.');
}
});
db.run(`
CREATE TABLE IF NOT EXISTS warnings (
guildId TEXT NOT NULL,
userId TEXT NOT NULL,
warningId INTEGER NOT NULL,
reason TEXT NOT NULL,
timestamp INTEGER NOT NULL,
PRIMARY KEY (guildId, userId, warningId)
);
`, (err) => {
if (err) {
console.error(err.message);
} else {
}
});
db.get('SELECT value FROM gestion WHERE id = ?', [client.user.id], (err, row) => {