From 16a446c9c11833988f05b21111636827b4083841 Mon Sep 17 00:00:00 2001 From: VALOU3336 Date: Tue, 27 Feb 2024 11:01:28 +0100 Subject: [PATCH] mini update help ans add sync --- commands/gestion/sync.js | 2 +- commands/logs/logs.js | 2 +- commands/logs/messagelog.js | 2 +- commands/logs/modlog.js | 2 +- commands/logs/raidlog.js | 2 +- commands/logs/rolelog.js | 2 +- commands/logs/vocallog.js | 2 +- commands/utils/help.js | 5 ++++- commands/utils/prevname.js | 3 +++ commands/utils/weather.js | 3 +++ events/client/ready.js | 3 ++- main.js | 2 -- 12 files changed, 19 insertions(+), 11 deletions(-) diff --git a/commands/gestion/sync.js b/commands/gestion/sync.js index 2472924..28de27f 100644 --- a/commands/gestion/sync.js +++ b/commands/gestion/sync.js @@ -2,7 +2,7 @@ const { ChannelType } = require("discord.js") module.exports = { name: 'sync', description: "Synchronise les permissions d'un salon avec sa catégorie ou synchronise tous les salons d'une catégorie.", - category: 'moderation', + category: 'gestion', emote: '🔄', utilisation: '+sync [#salon/id/all]', async execute(message, args, client) { diff --git a/commands/logs/logs.js b/commands/logs/logs.js index 31e70dc..9e9979f 100644 --- a/commands/logs/logs.js +++ b/commands/logs/logs.js @@ -4,7 +4,7 @@ const db = new sqlite3.Database('myDatabase.db'); module.exports = { name: 'logs', description: 'Affiche et configure les logs du serveur.', - category: 'logs', + category: 'gestion', emote: '📝', utilisation: '+logs', async execute(message, args) { diff --git a/commands/logs/messagelog.js b/commands/logs/messagelog.js index 307b3ee..55aff64 100644 --- a/commands/logs/messagelog.js +++ b/commands/logs/messagelog.js @@ -5,7 +5,7 @@ const db = new sqlite3.Database('myDatabase.db'); module.exports = { name: 'messagelog', description: 'Enregistre l\'ID d\'un salon pour les logs de messages.', - category: 'logs', + category: 'gestion', emote: '📝', utilisation: '+messagelog [#salon/id]', async execute(message, args, client) { diff --git a/commands/logs/modlog.js b/commands/logs/modlog.js index f271876..69d6412 100644 --- a/commands/logs/modlog.js +++ b/commands/logs/modlog.js @@ -5,7 +5,7 @@ const db = new sqlite3.Database('myDatabase.db'); module.exports = { name: 'modlog', description: 'Enregistre l\'ID d\'un salon pour les logs de modération.', - category: 'logs', + category: 'gestion', emote: '📝', utilisation: '+modlog [#salon/id]', async execute(message, args) { diff --git a/commands/logs/raidlog.js b/commands/logs/raidlog.js index 428a85b..aaf2239 100644 --- a/commands/logs/raidlog.js +++ b/commands/logs/raidlog.js @@ -4,7 +4,7 @@ const db = new sqlite3.Database('myDatabase.db'); module.exports = { name: 'raidlog', description: 'Enregistre l\'ID d\'un salon pour les logs de raid.', - category: 'logs', + category: 'gestion', emote: '📝', utilisation: '+raidlog [#salon/id]', async execute(message, args) { diff --git a/commands/logs/rolelog.js b/commands/logs/rolelog.js index 2355bda..f0bc5a2 100644 --- a/commands/logs/rolelog.js +++ b/commands/logs/rolelog.js @@ -4,7 +4,7 @@ const db = new sqlite3.Database('myDatabase.db'); module.exports = { name: 'rolelog', description: 'Enregistre l\'ID d\'un salon pour les logs de rôles.', - category: 'logs', + category: 'gestion', emote: '📝', utilisation: '+rolelog [#salon/id]', async execute(message, args) { diff --git a/commands/logs/vocallog.js b/commands/logs/vocallog.js index 2742813..4a20e3a 100644 --- a/commands/logs/vocallog.js +++ b/commands/logs/vocallog.js @@ -4,7 +4,7 @@ const db = new sqlite3.Database('myDatabase.db'); module.exports = { name: 'vocallog', description: 'Enregistre l\'ID d\'un salon pour les logs vocaux.', - category: 'logs', + category: 'gestion', emote: '📝', utilisation: '+vocallog [#salon/id]', async execute(message, args) { diff --git a/commands/utils/help.js b/commands/utils/help.js index ac98f4b..2b86e2b 100644 --- a/commands/utils/help.js +++ b/commands/utils/help.js @@ -52,6 +52,7 @@ module.exports = { game: [], gestion: [], utils: [], + other: [], }; let liste = []; @@ -62,8 +63,10 @@ module.exports = { } } for (const command of liste) { - if (command.category) { + if (command.category && categories[command.category]) { categories[command.category].push({ name: command.name, description: command.description, emote: command.emote, utilisation: command.utilisation}); + } else { + categories['other'].push({ name: command.name, description: command.description, emote: command.emote, utilisation: command.utilisation}); } } let totalCommands = liste.length diff --git a/commands/utils/prevname.js b/commands/utils/prevname.js index 83937c8..58359e8 100644 --- a/commands/utils/prevname.js +++ b/commands/utils/prevname.js @@ -4,6 +4,9 @@ const PrevnameDb = new db.table("prevname"); module.exports = { name: 'prevname', description: 'Affiche tous les pseudos précédents et permet de les supprimer', + category: 'utils', + emote: '🔍', + utilisation: 'prevname', async execute(message, args) { const userId = message.author.id; const nameChanges = PrevnameDb.get(`${userId}.nameChanges`) || []; diff --git a/commands/utils/weather.js b/commands/utils/weather.js index d06da80..1e6b9c0 100644 --- a/commands/utils/weather.js +++ b/commands/utils/weather.js @@ -4,6 +4,9 @@ const { EmbedBuilder } = require('discord.js'); module.exports = { name: 'weather', description: 'Affiche les informations météorologiques d\'une ville', + category: 'utils', + emote: '☀️', + utilisation: 'weather [ville]', async execute(message, args) { if (!args.length) { return message.channel.send('Veuillez fournir une ville.'); diff --git a/events/client/ready.js b/events/client/ready.js index 4b07c3e..e19eb6c 100644 --- a/events/client/ready.js +++ b/events/client/ready.js @@ -51,7 +51,8 @@ module.exports = { }); }); client.snipes = new Map(); - console.log(`Le bot ${client.user.tag} est en ligne`); + console.log(`Le bot ${client.user.tag} est en ligne +lien d'invite > https://discord.com/oauth2/authorize?client_id=${client.user.id}&scope=bot&permissions=8`); process.on('unhandledRejection', (reason, p) => { console.log(' [antiCrash] :: Unhandled Rejection/Catch'); console.log(reason, p); diff --git a/main.js b/main.js index b6d23dd..dbc828f 100644 --- a/main.js +++ b/main.js @@ -7,8 +7,6 @@ const client = new Client({intents: new IntentsBitField(3276799)}); client.events = new Collection(); client.commands = new Collection(); - - (async () => { loadCommands(client); loadEvents(client);