mirror of
https://github.com/arthur-pbty/gestion.git
synced 2026-06-20 13:50:39 +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 { EmbedBuilder , ButtonBuilder, ButtonStyle, ActionRowBuilder } = require('discord.js');
|
||||||
const sqlite3 = require('sqlite3').verbose();
|
const sqlite3 = require('sqlite3').verbose();
|
||||||
|
const db = new sqlite3.Database('myDatabase.db');
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'helpall',
|
name: 'helpall',
|
||||||
description: 'Liste toutes les commandes disponibles par niveau de permission',
|
description: 'Liste toutes les commandes disponibles par niveau de permission',
|
||||||
@@ -9,11 +9,10 @@ module.exports = {
|
|||||||
category: 'utils',
|
category: 'utils',
|
||||||
|
|
||||||
async execute(message, args, client) {
|
async execute(message, args, client) {
|
||||||
const db = new sqlite3.Database('myDatabase.db');
|
|
||||||
const botId = client.user.id;
|
const botId = client.user.id;
|
||||||
const guildId = message.guild.id;
|
const guildId = message.guild.id;
|
||||||
const defaultPrefix = "+";
|
const defaultPrefix = "+";
|
||||||
|
try {
|
||||||
let data = await new Promise((resolve, reject) => {
|
let data = await new Promise((resolve, reject) => {
|
||||||
db.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => {
|
db.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
@@ -97,5 +96,8 @@ module.exports = {
|
|||||||
});
|
});
|
||||||
|
|
||||||
collector.on('end', () => msg.edit({ embeds: [embeds[currentPage]], components: [] }));
|
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);
|
const event = require(filePath);
|
||||||
if (typeof event.execute === 'function') {
|
if (typeof event.execute === 'function') {
|
||||||
client.on(event.name, (...args) => event.execute(...args, client));
|
client.on(event.name, (...args) => event.execute(...args, client));
|
||||||
console.log(`Event ${event.name} loaded`);
|
|
||||||
count++;
|
count++;
|
||||||
} else {
|
} else {
|
||||||
console.error(`Event ${event.name} does not have an execute method.`);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user