correction d'eventual probleme lié au helpall

This commit is contained in:
VALOU3336
2024-03-02 14:56:25 +01:00
parent 44f5e84484
commit 0c3ad5a9d5
2 changed files with 5 additions and 5 deletions
+5 -3
View File
@@ -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.");
}
},
};
-2
View File
@@ -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.`);
}
}
});