Refactor database path resolution in cogs and improve cog loading error handling. Update database connections in Giveaway, Nightmode, and Owner cogs to use a centralized path resolver. Enhance cog loading feedback with success and failure messages.
Some checks failed
CI / Bot (Python) (push) Successful in 12s
CI / Dashboard (Next.js) (push) Failing after 9s

This commit is contained in:
TheOnlyMace
2026-07-21 22:28:18 +02:00
parent 9006b06c09
commit 18ef29f777
6 changed files with 114 additions and 44 deletions

View File

@@ -64,26 +64,11 @@ export default async function GuildsPage() {
}
try {
const res = await fetch("https://discord.com/api/users/@me/guilds", {
headers: {
Authorization: `Bearer ${session.accessToken}`,
},
cache: "no-store",
});
if (res.ok) {
userGuilds = await res.json();
} else {
const body = await res.text().catch(() => "");
console.error("Discord guilds fetch failed:", res.status, body);
userDiscordError =
res.status === 401
? "Discord session expired — please sign in again."
: "Failed to fetch your Discord servers.";
}
} catch (err) {
const { fetchUserGuilds } = await import("@/lib/guild-auth");
userGuilds = await fetchUserGuilds(session.accessToken);
} catch (err: any) {
console.error("Discord API Error:", err);
userDiscordError = "Error connecting to Discord.";
userDiscordError = err?.message || "Error connecting to Discord.";
}
const MANAGE_GUILD = BigInt(0x20);