refonte css of site

This commit is contained in:
Arthur Puechberty
2026-01-17 20:59:52 +01:00
parent 90339f9323
commit 95cd796839
20 changed files with 2951 additions and 1109 deletions
+20
View File
@@ -4,6 +4,26 @@ const loadSlashCommands = require("../slash_commands");
module.exports = (app, db, client) => {
// --- Bot info ---
router.get("/bot-info", (req, res) => {
const bot = client.user;
if (!bot) return res.status(500).json({ error: "Bot non connecté" });
let userCount = 0;
client.guilds.cache.forEach(g => {
userCount += g.memberCount;
});
res.json({
id: bot.id,
username: bot.username,
discriminator: bot.discriminator,
avatar: bot.avatar,
guildCount: client.guilds.cache.size,
userCount: userCount
});
});
// --- User info ---
router.get("/user", (req, res) => {
if (req.session.user) res.json(req.session.user);
+5
View File
@@ -8,6 +8,11 @@ const CLIENT_SECRET = process.env.CLIENT_SECRET;
const REDIRECT_URI = process.env.REDIRECT_URI;
module.exports = (app, db, client) => {
// --- Redirection login ---
router.get("/login", (req, res) => {
res.redirect("/auth/discord");
});
// --- Connexion Discord ---
router.get("/discord", (req, res) => {
const url = `https://discord.com/api/oauth2/authorize?client_id=${CLIENT_ID}&redirect_uri=${encodeURIComponent(REDIRECT_URI)}&response_type=code&scope=identify%20guilds`;