diff --git a/commands/antiraid/bunker.js b/commands/antiraid/bunker.js index dd7a717..c64f2b5 100644 --- a/commands/antiraid/bunker.js +++ b/commands/antiraid/bunker.js @@ -1,6 +1,8 @@ module.exports = { name: 'bunker', description: 'Activer le bot bunker', + emote: '🛡️', + utilisation: 'bunker', category: 'antiraid', async execute(message, args, client) { const guild = message.guild; diff --git a/commands/botcontrol/invite.js b/commands/botcontrol/invite.js index 77d2c67..ccf0293 100644 --- a/commands/botcontrol/invite.js +++ b/commands/botcontrol/invite.js @@ -3,7 +3,10 @@ const { PermissionsBitField } = require('discord.js'); module.exports = { name: 'invite', description: 'Crée un lien d\'invitation pour un serveur spécifique', + emote: '🔗', + utilisation: 'invite [guildId]', category: 'botcontrol', + async execute(message, args, client) { // Vérifie si l'ID du serveur a été fourni if (!args[0]) { diff --git a/commands/botcontrol/leave.js b/commands/botcontrol/leave.js new file mode 100644 index 0000000..98440fc --- /dev/null +++ b/commands/botcontrol/leave.js @@ -0,0 +1,27 @@ +const fs = require('fs'); +const path = require('path'); + +module.exports = { + name: 'leave', + description: 'Faire quitter le bot d\`un serveur', + emote: '🚪', + utilisation: 'leave [guildId]', + category: 'botcontrol', + + async execute(message, args, client) { + + // If an ID is provided, try to get the guild with that ID + const guildId = args[0]; + if (guildId) { + const guild = client.guilds.cache.get(guildId); + if (guild) { + guild.leave(); + message.reply(`Je vien de quitté: ${guild.name}`); + } else { + message.reply('Je ne suis pas dans ce serveur.'); + } + } else { + message.guild.leave(); + } + }, +}; \ No newline at end of file diff --git a/commands/botcontrol/listen.js b/commands/botcontrol/listen.js index a54abae..fbf7d7a 100644 --- a/commands/botcontrol/listen.js +++ b/commands/botcontrol/listen.js @@ -3,6 +3,8 @@ const { ActivityType } = require("discord.js"); module.exports = { name: 'listen', description: 'Changer le status du bot en listen', + emote: '🎧', + utilisation: 'listen ', category: 'botcontrol', async execute(message, args, client) { const streamText = args.join(' ') || 'Streaming'; diff --git a/commands/botcontrol/play.js b/commands/botcontrol/play.js index ea1f0a0..38e13e0 100644 --- a/commands/botcontrol/play.js +++ b/commands/botcontrol/play.js @@ -3,7 +3,10 @@ const { ActivityType } = require("discord.js"); module.exports = { name: 'play', description: 'Changer le status du bot en play', + emote: '🎵', + utilisation: 'play ', category: 'botcontrol', + async execute(message, args, client) { const streamText = args.join(' ') || 'Streaming'; const streamURL = 'https://www.twitch.tv/valou336_yt'; diff --git a/commands/botcontrol/say.js b/commands/botcontrol/say.js index c287769..5eeef96 100644 --- a/commands/botcontrol/say.js +++ b/commands/botcontrol/say.js @@ -1,6 +1,8 @@ module.exports = { name: 'say', description: 'Fait dire quelque chose au bot', + emote: '💬', + utilisation: 'say ', category: 'botcontrol', async execute(message, args) { // Vérifie si un message a été spécifié diff --git a/commands/botcontrol/servers.js b/commands/botcontrol/servers.js index d25ea4d..474b77d 100644 --- a/commands/botcontrol/servers.js +++ b/commands/botcontrol/servers.js @@ -5,6 +5,8 @@ const path = require('path'); module.exports = { name: 'servers', description: 'Liste les serveur du bot', + emote: '🌐', + utilisation: 'servers', category: 'botcontrol', async execute(message, args, client) { diff --git a/commands/botcontrol/set.js b/commands/botcontrol/set.js index 79b822b..daf5494 100644 --- a/commands/botcontrol/set.js +++ b/commands/botcontrol/set.js @@ -1,7 +1,9 @@ module.exports = { - name: 'set', - description: 'Modifier divers paramètres du bot.', - category: 'botcontrol', + name: 'set', + description: 'Modifier divers paramètres du bot.', + emote: '⚙️', + utilisation: 'set ', + category: 'botcontrol', async execute(message, args, client) { // Vérifiez si l'utilisateur a fourni suffisamment d'arguments if (args.length < 2) { diff --git a/commands/botcontrol/stream.js b/commands/botcontrol/stream.js index f38cbc1..ea32d50 100644 --- a/commands/botcontrol/stream.js +++ b/commands/botcontrol/stream.js @@ -3,6 +3,8 @@ const { ActivityType } = require("discord.js"); module.exports = { name: 'stream', description: 'Mettre le bot en stream', + emote: '🎥', + utilisation: 'stream ', category: 'botcontrol', async execute(message, args, client) { const streamText = args.join(' ') || 'Streaming'; diff --git a/commands/botcontrol/watch.js b/commands/botcontrol/watch.js index 9346087..17d9ca1 100644 --- a/commands/botcontrol/watch.js +++ b/commands/botcontrol/watch.js @@ -3,7 +3,10 @@ const { ActivityType } = require("discord.js"); module.exports = { name: 'watch', description: 'Changer le status du bot en watch', + emote: '👁️', + utilisation: 'watch ', category: 'botcontrol', + async execute(message, args, client) { const streamText = args.join(' ') || 'Streaming'; const streamURL = 'https://www.twitch.tv/valou336_yt'; diff --git a/commands/game/2048.js b/commands/game/2048.js index 490980c..808a92c 100644 --- a/commands/game/2048.js +++ b/commands/game/2048.js @@ -2,8 +2,11 @@ const { TwoZeroFourEight } = require('discord-gamecord'); module.exports = { name: '2048', - description: 'Jouer au jeu 2048', + description: 'Jouer au jeu 2048', + emote: '🎲', + utilisation: '2048', category: 'game', + async execute(message, args) { const Game = new TwoZeroFourEight({ message: message, diff --git a/commands/game/8ball.js b/commands/game/8ball.js index 8e25659..33ddcee 100644 --- a/commands/game/8ball.js +++ b/commands/game/8ball.js @@ -1,6 +1,8 @@ module.exports = { name: '8ball', description: 'Posez une question à la boule magique 8', + emote: '🔮', + utilisation: '8ball ', category: 'game', execute(message, args) { if (!args[0]) { diff --git a/commands/game/catsay.js b/commands/game/catsay.js index ef30821..80201e0 100644 --- a/commands/game/catsay.js +++ b/commands/game/catsay.js @@ -1,6 +1,8 @@ module.exports = { name: 'catsay', description: 'Faire parler les chat', + emote: '🐱', + utilisation: 'catsay ', category: 'game', async execute( message, args) { diff --git a/commands/game/demineur.js b/commands/game/demineur.js index 79a2524..dc723de 100644 --- a/commands/game/demineur.js +++ b/commands/game/demineur.js @@ -3,6 +3,8 @@ const { Minesweeper } = require('discord-gamecord'); module.exports = { name: 'demineur', description: 'Jouer à un jeu démineur', + emote: '💣', + utilisation: 'demineur', category: 'game', async execute(message, args) { const Game = new Minesweeper({ diff --git a/commands/game/fasttype.js b/commands/game/fasttype.js index a3ed25d..3e3ce1b 100644 --- a/commands/game/fasttype.js +++ b/commands/game/fasttype.js @@ -29,6 +29,8 @@ const sentences = [ module.exports = { name: 'fasttype', description: 'Jouer à un jeu de vitesse de frappe', + emote: '⌨️', + utilisation: 'fasttype', category: 'game', async execute(message, args) { const randomSentence = sentences[Math.floor(Math.random() * sentences.length)]; diff --git a/commands/game/findemoji.js b/commands/game/findemoji.js index d8b10a8..7fb0acb 100644 --- a/commands/game/findemoji.js +++ b/commands/game/findemoji.js @@ -3,7 +3,10 @@ const { FindEmoji } = require('discord-gamecord'); module.exports = { name: 'findemoji', description: 'Jouer au jeu Trouver Emoji', + emote: '🔍', + utilisation: 'findemoji', category: 'game', + async execute(message, args) { const Game = new FindEmoji({ message: message, diff --git a/commands/game/flood.js b/commands/game/flood.js index bd5fd43..f0096a8 100644 --- a/commands/game/flood.js +++ b/commands/game/flood.js @@ -3,6 +3,8 @@ const { Flood } = require('discord-gamecord'); module.exports = { name: 'flood', description: 'Jouer au jeu Flood', + emote: '🌊', + utilisation: 'flood', category: 'game', async execute(message, args) { const Game = new Flood({ diff --git a/commands/game/guessThePokemon.js b/commands/game/guessThePokemon.js index 359c1e4..fef8f81 100644 --- a/commands/game/guessThePokemon.js +++ b/commands/game/guessThePokemon.js @@ -1,9 +1,11 @@ const { GuessThePokemon } = require('discord-gamecord'); module.exports = { - name: 'guesspokemon', - description: 'Jouer au jeu trouver le pokemon', - category: 'game', + name: 'guesspokemon', + description: 'Jouer au jeu trouver le pokemon', + emote: '🐼', + utilisation: 'guesspokemon', + category: 'game', async execute(message, args) { const Game = new GuessThePokemon({ message: message, diff --git a/commands/game/morpion.js b/commands/game/morpion.js index 33cf814..ad275e0 100644 --- a/commands/game/morpion.js +++ b/commands/game/morpion.js @@ -3,6 +3,8 @@ const { TicTacToe } = require('discord-gamecord'); module.exports = { name: 'morpion', description: 'Jouer à morpion', + emote: '⭕', + utilisation: 'morpion', category: 'game', async execute(message, args) { if (!message.mentions.members.first()) diff --git a/commands/game/pendu.js b/commands/game/pendu.js index 289463f..8b05173 100644 --- a/commands/game/pendu.js +++ b/commands/game/pendu.js @@ -28,7 +28,10 @@ const words = [ module.exports = { name: 'pendu', description: 'Jouer à pendu', + emote: '🎩', + utilisation: 'pendu', category: 'game', + async execute(message, args) { const game = new Hangman({ message: message, diff --git a/commands/game/pfc.js b/commands/game/pfc.js index b88131e..8c5ae33 100644 --- a/commands/game/pfc.js +++ b/commands/game/pfc.js @@ -3,6 +3,8 @@ const choices = ["pierre", "papier", "ciseaux"]; module.exports = { name: 'pfc', description: 'Jouer à pierre-papier-ciseaux', + emote: '✊', + utilisation: 'pfc', category: 'game', async execute(message, args) { const userChoice = args[0]; diff --git a/commands/game/puissance4.js b/commands/game/puissance4.js index 7288beb..cb4036f 100644 --- a/commands/game/puissance4.js +++ b/commands/game/puissance4.js @@ -1,9 +1,10 @@ const { Connect4 } = require('discord-gamecord') -const color = '#0099ff'; // Définit +const color = '#0099ff'; module.exports = { name: 'puissance4', - usage: 'puissance4', - description: 'Lancer une partis de puissance4', + utilisation: 'puissance4', + description: 'Lancer une partie de puissance4', + emote: '🔴', category: 'game', async execute(message) { diff --git a/commands/game/slot.js b/commands/game/slot.js index d614710..ed6304f 100644 --- a/commands/game/slot.js +++ b/commands/game/slot.js @@ -1,9 +1,11 @@ const { Slots } = require('discord-gamecord'); module.exports = { - name: 'slot', - description: 'Jouer au jeu Slot', - category: 'game', + name: 'slot', + description: 'Jouer au jeu Slot', + emote: '🎰', + utilisation: 'slot', + category: 'game', async execute(message, args) { const Game = new Slots({ message: message, diff --git a/commands/game/snake.js b/commands/game/snake.js index f955810..de98960 100644 --- a/commands/game/snake.js +++ b/commands/game/snake.js @@ -2,9 +2,11 @@ const { Snake } = require("discord-gamecord") const color = '#0099ff'; // Définit module.exports = { name: 'snake', - usage: 'snake', - description: 'Lancer une partis de snake', + utilisation: 'snake', + description: 'Lancer une partie de snake', + emote: '🐍', category: 'game', + async execute(message, args) { new Snake({ diff --git a/commands/game/wordle.js b/commands/game/wordle.js index 3b2229d..ca94424 100644 --- a/commands/game/wordle.js +++ b/commands/game/wordle.js @@ -48,9 +48,12 @@ const words = [ ]; const shortWords = words.filter(word => word.length === 5); module.exports = { - name: 'wordle', - description: 'Jouer à Wordle', - category: 'game', + name: 'wordle', + description: 'Jouer à Wordle', + emote: '🔡', + utilisation: 'wordle', + category: 'game', + async execute(message, args) { const Game = new Wordle({ message: message, diff --git a/commands/gestion/dm.js b/commands/gestion/dm.js index 85131ad..856f364 100644 --- a/commands/gestion/dm.js +++ b/commands/gestion/dm.js @@ -1,7 +1,10 @@ module.exports = { name: 'dm', description: 'Envoie un message privé à un utilisateur', + emote: '📧', + utilisation: 'dm <@utilisateur> ', category: 'gestion', + async execute(message, args) { // Vérifie si un utilisateur a été mentionné const user = message.mentions.users.first(); diff --git a/commands/gestion/massiverole.js b/commands/gestion/massiverole.js index 804da55..d72a876 100644 --- a/commands/gestion/massiverole.js +++ b/commands/gestion/massiverole.js @@ -3,7 +3,10 @@ const { EmbedBuilder, ActionRowBuilder, StringSelectMenuBuilder } = require('dis module.exports = { name: 'massiverole', description: 'Donne un rôle à tous les membres du serveur', + emote: '👥', + utilisation: 'massiverole <@role>', category: 'gestion', + async execute(message, args) { // Vérifie si un rôle a été mentionné const role = message.mentions.roles.first(); diff --git a/commands/gestion/renew.js b/commands/gestion/renew.js index c49a91c..e2c5cb2 100644 --- a/commands/gestion/renew.js +++ b/commands/gestion/renew.js @@ -2,7 +2,10 @@ const { PermissionsBitField} = require("discord.js") module.exports = { name: 'renew', description: 'Renew un salon', + emote: '🔄', + utilisation: 'renew', category: 'gestion', + async execute(message, args, client) { const guild = message.guild; const channel = message.mentions.channels.first() || message.channel; diff --git a/commands/gestion/unmassiverole.js b/commands/gestion/unmassiverole.js index fbad5e2..03f4fa7 100644 --- a/commands/gestion/unmassiverole.js +++ b/commands/gestion/unmassiverole.js @@ -3,6 +3,8 @@ const { EmbedBuilder, ActionRowBuilder, StringSelectMenuBuilder } = require('dis module.exports = { name: 'unmassiverole', description: 'Retire un rôle à tous les membres du serveur', + emote: '👥', + utilisation: 'unmassiverole <@role>', category: 'gestion', async execute(message, args, client) { // Vérifie si un rôle a été mentionné diff --git a/commands/utils/avatar.js b/commands/utils/avatar.js index e8098ed..b9f1fa7 100644 --- a/commands/utils/avatar.js +++ b/commands/utils/avatar.js @@ -1,8 +1,9 @@ const { EmbedBuilder, ButtonStyle, ButtonBuilder, ActionRowBuilder } = require("discord.js") module.exports = { - name: 'avatar', + name: 'pic', description: 'Affiche l\'avatar d\'un utilisateur', category: 'utils', + utilisation: 'pic [@user/userId]', async execute(message, args, client) { let user; if (message.mentions.users.size > 0) { diff --git a/commands/help.js b/commands/utils/help.js similarity index 91% rename from commands/help.js rename to commands/utils/help.js index e37857e..da426cd 100644 --- a/commands/help.js +++ b/commands/utils/help.js @@ -4,7 +4,7 @@ module.exports = { description: 'Affiche la liste des commandes', category: 'other', emote: '📚', - utilisation: '', + utilisation: 'help [commande]', async execute(message, args, client) { if (args[0]) { // L'utilisateur a fourni un argument, affichez l'aide pour cette commande @@ -18,7 +18,7 @@ module.exports = { .setTitle(`Aide pour la commande ${command.emote ? ` ${command.emote}` : '🔧'} ${command.name}`) .setDescription(command.description) .addFields( - { name: 'Utilisation', value: `\`+${command.name}${command.utilisation ? ` ${command.utilisation}` : ''}\``, inline: true }, + { name: 'Utilisation', value: `\`+${command.utilisation ? ` **${command.utilisation}**` : ''}\``, inline: true }, { name: 'Catégorie', value: command.category || 'Non spécifiée', inline: true } ); @@ -63,7 +63,7 @@ module.exports = { for (const [category, commands] of Object.entries(categories)) { let description; if (commands.length > 0) { - description = commands.map(command => `${command.emote ? ` ${command.emote}` : '🔧'} \`+${command.name}${command.utilisation ? ` ${command.utilisation}` : ''}\`\n ${command.description}`).join('\n'); + description = commands.map(command => `${command.emote ? ` ${command.emote}` : '🔧'} **+${command.utilisation ? ` ${command.utilisation}` : ''}**\n \`${command.description}\``).join('\n'); } else { description = 'Aucune commande dans cette catégorie.'; } @@ -88,7 +88,7 @@ module.exports = { const sentMessage = await message.reply({ embeds: [embeds.home], components: [row] }); const filter = i => i.customId === 'help_menu' && i.user.id === message.author.id; - const collector = sentMessage.createMessageComponentCollector({ filter, time: 15000 }); + const collector = sentMessage.createMessageComponentCollector({ filter, time: 60000 }); collector.on('collect', async (interaction) => { await interaction.update({ embeds: [embeds[interaction.values[0]]] }); }); diff --git a/commands/utils/ping.js b/commands/utils/ping.js index 11ffb29..473afc8 100644 --- a/commands/utils/ping.js +++ b/commands/utils/ping.js @@ -2,7 +2,9 @@ const { ButtonStyle, ButtonBuilder, ActionRowBuilder } = require('discord.js'); module.exports = { name: 'ping', - description: 'Command to check the latency of the bot.', + description: 'Avoir la latence du bot.', + emote: '⏱️', + utilisation: 'ping', category: 'utils', async execute(message, args, client) { const ping = new ButtonBuilder() diff --git a/commands/utils/serverinfo.js b/commands/utils/serverinfo.js index b7f22e6..08a6d5f 100644 --- a/commands/utils/serverinfo.js +++ b/commands/utils/serverinfo.js @@ -2,27 +2,25 @@ const { EmbedBuilder } = require("discord.js") module.exports = { name: 'serverinfo', description: 'Affiche les informations sur le serveur', + emote: '📄', + utilisation: 'serverinfo', category: 'utils', + async execute(message, args, client) { const embed = new EmbedBuilder() - .setAuthor({name: `${message.guild.name}`, iconURL: message.guild.iconURL({dynamic : true})}) - .setDescription(`**ID :** ${message.guild.id} - **Nom :** ${message.guild.name} - **Propriétaire :** ${message.guild.owner} - **Créé le :** - **Membres :** ${message.guild.memberCount} - **Salons :** ${message.guild.channels.cache.size} - **Rôles :** ${message.guild.roles.cache.size} - **Emojis :** ${message.guild.emojis.cache.size} - **Boosts :** ${message.guild.premiumSubscriptionCount} - **Niveau de boost :** ${message.guild.premiumTier} - **Région :** ${message.guild.region} - **Niveau de vérification :** ${message.guild.verificationLevel} - **Notifications :** ${message.guild.defaultMessageNotifications} - **Système de vérification :** ${message.guild.explicitContentFilter} - **Niveau de vérification :** ${message.guild.verificationLevel} - `) - .setThumbnail(message.guild.iconURL({dynamic : true})) + .setColor("#FFFFFF") + .setTitle(`Information du bot \`${client.user.username}\``) + .setThumbnail(client.user.displayAvatarURL({dynamic: true})) + .addFields([ + { name: '📚 Nom', value: `\`${client.user.username}\``, inline: true }, + { name: '🆔 ID', value: `\`${client.user.id}\``, inline: true }, + { name: '👨‍💻 Développeur', value: `\`valou336\` && \`tuturp33\``}, + { name: '⏳ Uptime', value: `\`\`\`${Math.round(client.uptime / (1000 * 60 * 60))}h ${Math.round(client.uptime / (1000 * 60)) % 60}m ${Math.round(client.uptime / 1000) % 60}\`\`\``}, + { name: '➡️ Discord Version', value: `\`${require('discord.js').version}\``, inline: true }, + { name: '⏯️ Node Version', value: `\`${process.version}\``, inline: true } + ]) + .setTimestamp() + .setFooter({text: `${client.user.tag} © 2024`, iconURL: client.user.displayAvatarURL({dynamic: true})}); message.reply({ embeds: [embed] }); }, diff --git a/commands/utils/snipe.js b/commands/utils/snipe.js index f3c1fb2..141d64b 100644 --- a/commands/utils/snipe.js +++ b/commands/utils/snipe.js @@ -2,7 +2,10 @@ const { EmbedBuilder, User } = require("discord.js") module.exports = { name: 'snipe', description: 'Affiche le dernier message supprimé dans le salon', + emote: '🔍', + utilisation: 'snipe', category: 'utils', + async execute(message, args, client) { // Récupère le dernier message supprimé du salon let snipe = client.snipes.get(message.channel.id); diff --git a/commands/utils/userinfo.js b/commands/utils/userinfo.js index 1fbc1b4..73639f8 100644 --- a/commands/utils/userinfo.js +++ b/commands/utils/userinfo.js @@ -2,7 +2,10 @@ const { EmbedBuilder } = require("discord.js") module.exports = { name: 'userinfo', description: 'Affiche les informations sur un utilisateur', + emote: '👤', + utilisation: 'userinfo', category: 'utils', + async execute(message, args, client) { let user; if (args.length > 0) {