mirror of
https://github.com/arthur-pbty/gestion.git
synced 2026-06-03 15:07:26 +02:00
correction d'eventual probleme lié au helpall
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
const { EmbedBuilder , ButtonBuilder, ButtonStyle, ActionRowBuilder } = require('discord.js');
|
||||
const sqlite3 = require('sqlite3').verbose();
|
||||
|
||||
const db = new sqlite3.Database('myDatabase.db');
|
||||
module.exports = {
|
||||
name: 'helpall',
|
||||
description: 'Liste toutes les commandes disponibles par niveau de permission',
|
||||
@@ -9,11 +9,10 @@ module.exports = {
|
||||
category: 'utils',
|
||||
|
||||
async execute(message, args, client) {
|
||||
const db = new sqlite3.Database('myDatabase.db');
|
||||
const botId = client.user.id;
|
||||
const guildId = message.guild.id;
|
||||
const defaultPrefix = "+";
|
||||
|
||||
try {
|
||||
let data = await new Promise((resolve, reject) => {
|
||||
db.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => {
|
||||
if (err) {
|
||||
@@ -97,5 +96,8 @@ module.exports = {
|
||||
});
|
||||
|
||||
collector.on('end', () => msg.edit({ embeds: [embeds[currentPage]], components: [] }));
|
||||
}catch (error) {
|
||||
return message.reply("Veuillez changer des commandes de permission pour avoir accès au helpall.");
|
||||
}
|
||||
},
|
||||
};
|
||||
@@ -13,10 +13,8 @@ module.exports = (client) => {
|
||||
const event = require(filePath);
|
||||
if (typeof event.execute === 'function') {
|
||||
client.on(event.name, (...args) => event.execute(...args, client));
|
||||
console.log(`Event ${event.name} loaded`);
|
||||
count++;
|
||||
} else {
|
||||
console.error(`Event ${event.name} does not have an execute method.`);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user