mirror of
https://github.com/arthur-pbty/gestion.git
synced 2026-06-03 15:07:26 +02:00
28 lines
944 B
JavaScript
28 lines
944 B
JavaScript
const fs = require('fs');
|
|
const path = require('path');
|
|
const db = require('quick.db');
|
|
const GestionDb = new db.table("gestion");
|
|
|
|
module.exports = {
|
|
name: 'permupdate',
|
|
description: 'Mettre à jour les permissions dans le fichier permissions.json',
|
|
emote: '🔒',
|
|
utilisation: 'permupdate',
|
|
category: 'buyer',
|
|
|
|
async execute(message, args, client) {
|
|
const commands = Array.from(client.commands.keys());
|
|
const permissionsPath = path.resolve(__dirname, '../permissions.json');
|
|
const permissionsJson = JSON.parse(fs.readFileSync(permissionsPath));
|
|
|
|
commands.forEach(command => {
|
|
if (!permissionsJson.hasOwnProperty(command)) {
|
|
permissionsJson[command] = 5;
|
|
}
|
|
});
|
|
|
|
fs.writeFileSync(permissionsPath, JSON.stringify(permissionsJson, null, 2));
|
|
|
|
message.reply('Les permissions ont été mises à jour avec succès.');
|
|
},
|
|
}; |