add a major part of user level

This commit is contained in:
Arthur Puechberty
2026-01-16 23:41:39 +01:00
parent 20f7e080a8
commit 08b444efdd
10 changed files with 810 additions and 207 deletions
+40
View File
@@ -0,0 +1,40 @@
window.guildId = window.location.pathname.split("/")[2];
// Nom du serveur
fetch("/api/guilds")
.then(res => res.json())
.then(guilds => {
const guild = guilds.find(g => g.id === guildId);
document.getElementById("guild-name").textContent =
guild ? `Dashboard : ${guild.name}` : "Serveur introuvable";
});
// Channels texte
fetch(`/api/bot/get-text-channels/${guildId}`)
.then(res => res.json())
.then(channels => {
const welcome = document.getElementById("welcome-channel");
const goodbye = document.getElementById("goodbye-channel");
const levelAnnouncements = document.getElementById("level-announcements-channel");
channels.forEach(c => {
const opt = new Option(`#${c.name}`, c.id);
welcome?.appendChild(opt);
goodbye?.appendChild(opt.cloneNode(true));
levelAnnouncements?.appendChild(opt.cloneNode(true));
});
});
// Rôles
fetch(`/api/bot/get-roles/${guildId}`)
.then(res => res.json())
.then(roles => {
const newUser = document.getElementById("autorole-role");
const vocal = document.getElementById("autorole-vocal-role");
roles.forEach(r => {
const opt = new Option(r.name, r.id);
newUser?.appendChild(opt);
vocal?.appendChild(opt.cloneNode(true));
});
});