Discord Badge Bot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { Client } = require("discord.js"); | |
const bot = new Client({ intents: ["Guilds"] }); | |
console.log("Connexion au bot..."); | |
bot.login("TON TOKEN") | |
.then(() => console.log("Connecté au bot !")) | |
.catch((error) => console.log("Impossible de se connecter au bot - " + error)); | |
bot.on("ready", async () => { | |
await bot.application.commands.set([ | |
{ | |
name: "ping", | |
description: "Pong!" | |
} | |
]); | |
console.log("Le bot est prêt !"); | |
}); | |
bot.on("interactionCreate", (interaction) => { | |
if (!interaction.isCommand()) return; | |
if (interaction.commandName === "ping") | |
interaction.reply("Pong!"); | |
}); |
Good code
Good code
Good code
good code
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Good Coder