diff --git a/PPgestionBot.png b/PPgestionBot.png new file mode 100644 index 0000000..b11649e Binary files /dev/null and b/PPgestionBot.png differ diff --git a/README.md b/README.md index a55807f..e9574b9 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,59 @@ -# gestion -Bot by Tutur & Valou +# Nom du Bot Discord + +![Logo du Bot](PPgestionBot.png) + +## Description + +Le Bot Discord Gestion est un bot multifonction développé en JavaScript utilisant la bibliothèque Discord.js. Il est conçu pour offrir diverses fonctionnalités utiles pour les serveurs Discord. + +## Fonctionnalités + +- **Commandes de base :** Commandes telles que !help, !ping, etc. +- **Modération :** Commandes de modération pour gérer les utilisateurs et les messages. +- **Fun :** Commandes amusantes pour divertir les membres du serveur. +- **Musique :** Lecture de musique depuis YouTube et autres plateformes. + +## Installation + +1. Cloner le référentiel : + +```bash +git clone https://github.com/votre_utilisateur/nom-du-bot.git +``` + +2. Installer les dépendances : + +``` +cd nom-du-bot +npm install +``` + +3. Ajouter le fichier .env avec votre token bot. + +``` +TOKEN=votre_token_ici +``` + +4. Lancer le bot : + +```js +node main.js +``` + +## Contribuer + +Si vous souhaitez contribuer à ce projet, suivez ces étapes : + +1. Fork du projet +2. Créer une branche pour votre fonctionnalité (git checkout -b fonctionnalite/ma-fonctionnalite) +3. Commit de vos modifications (git commit -am 'Ajout de la fonctionnalité ma-fonctionnalite') +4. Push vers la branche (git push origin fonctionnalite/ma-fonctionnalite) +5. Ouvrir une Pull Request + +## Auteurs +tutur33 - Développeur principal +valou336 - Développeur principal + +## Licence + +Ce projet est sous licence Apache 2.0. Consultez le fichier LICENSE pour plus de détails. diff --git a/commands/utils/ping.js b/commands/ping.js similarity index 100% rename from commands/utils/ping.js rename to commands/ping.js diff --git a/events/client/interactionCreate.js b/events/client/interactionCreate.js index b320668..b1e0f4f 100644 --- a/events/client/interactionCreate.js +++ b/events/client/interactionCreate.js @@ -1,14 +1,11 @@ -const { Events, InteractionType } = require("discord.js") +const { Events, InteractionType } = require("discord.js"); module.exports = { - - name :Events.InteractionCreate, - async run(client, interaction) { - - if(interaction.type === InteractionType.ApplicationCommand) { - - const command = client.commands.get(interaction.commandName); - await command.execute(interaction, client); - }; + name: Events.InteractionCreate, + async run(client, interaction) { + if (interaction.type === InteractionType.ApplicationCommand) { + const command = client.commands.get(interaction.commandName); + await command.execute(interaction, client); } -}; \ No newline at end of file + }, +}; diff --git a/events/client/messageCreate.txt b/events/client/messageCreate.txt deleted file mode 100644 index 2074976..0000000 --- a/events/client/messageCreate.txt +++ /dev/null @@ -1,23 +0,0 @@ -module.exports = { - name: 'messageCreate', - async execute(client, message) { - const prefix = '!'; // Assurez-vous que le préfixe est défini ici aussi - - if (!message.content.startsWith(prefix) || message.author.bot) return; - - const args = message.content.slice(prefix.length).trim().split(/ +/); - const commandName = args.shift().toLowerCase(); - - // Si la commande n'existe pas, ne faites rien - if (!client.commands.has(commandName)) return; - - const command = client.commands.get(commandName); - - try { - command.execute(client, message, args); - } catch (error) { - console.error(error); - message.reply('Il y a eu une erreur lors de l\'exécution de cette commande.'); - } - }, -}; \ No newline at end of file diff --git a/events/client/ready.js b/events/client/ready.js index 4f27e8b..eddc926 100644 --- a/events/client/ready.js +++ b/events/client/ready.js @@ -1,15 +1,8 @@ -const { Events, ActivityType } = require("discord.js") +const { Events, ActivityType } = require("discord.js"); + module.exports = { - - name : Events.ClientReady, - async execute(client) { - - //if (client.commands && Array.isArray(client.commands)) { - // client.application.commands.set(client.commands.map(command => command.data)); - //} else { - //console.error('Les commandes du client sont manquantes ou mal formatées'); - //} - console.log(`${client.user.username} est en ligne`); - - }, + name: Events.ClientReady, + async run(client) { + + } }; \ No newline at end of file diff --git a/main.js b/main.js index 701de86..06eaa47 100644 --- a/main.js +++ b/main.js @@ -1,18 +1,20 @@ require('dotenv').config(); const { Client, IntentsBitField, Collection } = require("discord.js"); -const loadCommands = require("./loaders/loadCommands") +const loadCommands = require("./loaders/loadCommands"); const loadEvents = require("./loaders/loadEvents"); + const client = new Client({intents: new IntentsBitField(3276799)}); + client.on('ready', () => { console.log(`Logged in as ${client.user.tag}!`); }); client.events = new Collection(); client.commands = new Collection(); client.snipes = new Collection(); + (async () => { - await loadCommands(client); - await loadEvents(client); + loadCommands(client); + loadEvents(client); await client.login(process.env.TOKEN); -})(); -client.login(process.env.TOKEN); \ No newline at end of file +})(); \ No newline at end of file