Skip to content

Instantly share code, notes, and snippets.

@Raraph84
Created November 11, 2022 20:39
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save Raraph84/cff3ff908a1f2692b9a8452d2f49c2bf to your computer and use it in GitHub Desktop.
Save Raraph84/cff3ff908a1f2692b9a8452d2f49c2bf to your computer and use it in GitHub Desktop.
Discord Badge Bot
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!");
});
@baderox
Copy link

baderox commented Nov 15, 2022

Good Coder

@LIANN-DARDS900
Copy link

Good code

@SunsetTadpole78
Copy link

Good code

@AuTruche0
Copy link

Good code

@ezbyldw
Copy link

ezbyldw commented Sep 28, 2023

good code

@bionix61
Copy link

good code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment