@tamazia/suyo
v1.0.0
Published
Un framework puissant et élégant pour créer des bots discord.js v14+ rapidement.
Maintainers
Readme
🚀 Suyo Framework
Suyo est un framework puissant, rapide et élégant pour créer des bots Discord avec discord.js (v14+). Il inclut par défaut :
- ✅ Un affichage console propre, coloré et détaillé (OS, Ping, Serveurs) via
chalk - ✅ Un handler natif pour les commandes Prefix (e.g.
!ping) - ✅ Un handler natif pour les commandes Slash (
/ping) - ✅ Un handler natif pour les événements discord (
ready,messageCreate...) - ✅ Gestion intégrée des cooldowns par commande
📦 Installation
npm install @tamazia/suyo(Note : discord.js et chalk s'installeront automatiquement)
🛠️ Utilisation Rapide
Créez un fichier index.js ou bot.js à la racine de votre projet :
const { SuyoBot } = require('@tamazia/suyo');
const path = require('path');
const client = new SuyoBot({
token: 'COMPLETER_AVEC_VOTRE_TOKEN',
prefix: '!',
clientId: 'VOTRE_CLIENT_ID', // Requis pour enregistrer les Slash Commands
commandsDir: path.join(__dirname, 'commands'), // Dossier de commandes
eventsDir: path.join(__dirname, 'events'), // Dossier d'événements
});
// Démarre le bot !
client.start();📁 Architecture des dossiers
Votre projet doit ressembler à ça :
📁 mon-bot
┣ 📁 commands
┃ ┣ 📁 general
┃ ┃ ┗ 📜 ping.js (Commande Prefix)
┃ ┗ 📁 slash
┃ ┗ 📜 help.js (Commande Slash)
┣ 📁 events
┃ ┣ 📜 ready.js
┃ ┗ 📜 messageCreate.js
┣ 📜 index.js
┗ 📜 package.json📝 Créer un événement
events/ready.js
module.exports = {
name: 'ready',
once: true,
execute(client) {
console.log('Bot fully loaded and customized ready logic triggered!');
}
};⌨️ Créer une commande Prefix
commands/general/ping.js
module.exports = {
name: 'ping',
description: 'Renvoie la latence',
aliases: ['p'],
cooldown: 3, // secondes
async execute(message, args, client) {
message.reply(`Pong! API: ${client.ws.ping}ms`);
}
};⚡ Créer une commande Slash
commands/slash/ping.js
const { SlashCommandBuilder } = require('@tamazia/suyo'); // export direct depuis D.js
module.exports = {
data: new SlashCommandBuilder()
.setName('ping')
.setDescription('Répond avec Pong.'),
cooldown: 5,
async execute(interaction, client) {
await interaction.reply(`Pong! PING API: ${client.ws.ping}ms`);
}
};Auteur: HamzaGSopp ( @hamza_ltc )
