Skip to content

Instantly share code, notes, and snippets.

@Raraph84
Created November 11, 2022 20:39
Show Gist options
  • 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!");
});
@SleepyA32
Copy link

Good Code

@Alexarde
Copy link

Alexarde commented Dec 30, 2024

Good Code
These are batch coded programs, one used to start your discord bot and the other to install discord.js :
https://github.com/Alexarde/discord-bot/releases/tag/discord-bot
These 2 programs must be placed at the root of your discord bot folder in order to function correctly

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