Initial commit

This commit is contained in:
Shinuwa 2026-06-28 19:32:49 +02:00
commit 0dabb7c3c0
7 changed files with 924 additions and 0 deletions

View file

@ -0,0 +1,25 @@
import { Client, GatewayIntentBits } from "discord.js";
import { config } from "../static/config.js";
const client = new Client({
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages],
});
async function initDiscordBot() {
await client.login(config.token);
console.log("✅ Discord bot connecté !");
}
async function sendDiscordAlert(message) {
try {
const channel = await client.channels.fetch(config.textChannelId);
await channel.send(message);
} catch (err) {
console.error("❌ Erreur envoi Discord :", err);
}
}
export {
initDiscordBot,
sendDiscordAlert
}