Intermédiaire45 min de lecture
Discord.jsNode.jsBot
Construire un bot Discord de A à Z
Un tutoriel complet pour créer, héberger et déployer votre premier bot Discord.
Construire un bot Discord de A à Z
Prérequis
- Node.js 18+
- Un compte Discord Developer
Étape 1 : Initialiser le projet
npm init -y
npm install discord.js
Étape 2 : Créer le client
import { Client, GatewayIntentBits } from "discord.js";
const client = new Client({ intents: [GatewayIntentBits.Guilds] });
client.login(process.env.TOKEN);
Étape 3 : Déployer
Hébergez votre bot sur un VPS ou un service comme Railway.