diff options
| author | Andrew Lee <andrew@alee14.me> | 2025-03-24 01:29:33 -0400 |
|---|---|---|
| committer | Andrew Lee <andrew@alee14.me> | 2025-03-24 01:29:33 -0400 |
| commit | 0453bafa63ccd1057279a1be9286b3e7ebcb62d2 (patch) | |
| tree | 0a71e0c06912a81ac009b196c5fee8dc9037cb60 /web/src/app | |
| parent | a19b6ed4ef829697fd0be153af5e27c99f267787 (diff) | |
| download | AleeBot-0453bafa63ccd1057279a1be9286b3e7ebcb62d2.tar.gz AleeBot-0453bafa63ccd1057279a1be9286b3e7ebcb62d2.tar.bz2 AleeBot-0453bafa63ccd1057279a1be9286b3e7ebcb62d2.zip | |
Depcreating web server, returning back to using Discord as settings
Diffstat (limited to 'web/src/app')
| -rw-r--r-- | web/src/app/components/Guilds.jsx | 12 | ||||
| -rw-r--r-- | web/src/app/dashboard/page.js | 18 |
2 files changed, 21 insertions, 9 deletions
diff --git a/web/src/app/components/Guilds.jsx b/web/src/app/components/Guilds.jsx index 50baa98..38626e4 100644 --- a/web/src/app/components/Guilds.jsx +++ b/web/src/app/components/Guilds.jsx @@ -8,18 +8,18 @@ export default async function Guilds({session}) { }); const guilds = await response.json(); + const ADMINISTRATOR = 0x0000000000000008; const MANAGE_GUILD = 0x00000020; const filteredGuilds = guilds.filter((guild) => { // Convert permissions string to a BigInt for bitwise operations const permissions = BigInt(guild.permissions); - // Check if MANAGE_GUILD bit is set - return (permissions & BigInt(MANAGE_GUILD)) === BigInt(MANAGE_GUILD); - }); + // Check if user is owner, has ADMINISTRATOR or MANAGE_GUILD permissions + return guild.owner || + (permissions & BigInt(ADMINISTRATOR)) === BigInt(ADMINISTRATOR) || + (permissions & BigInt(MANAGE_GUILD)) === BigInt(MANAGE_GUILD); }); return filteredGuilds.map((guild) => ( - <div key={guild.id}> - <h2>{guild.name}</h2> - </div> + <div key={guild.id} className="p-1">{guild.name}</div> )) } diff --git a/web/src/app/dashboard/page.js b/web/src/app/dashboard/page.js index d6e3a41..bab3bd8 100644 --- a/web/src/app/dashboard/page.js +++ b/web/src/app/dashboard/page.js @@ -8,7 +8,7 @@ export default async function Home() { if (!session) redirect("/"); return ( - <div> + <> <nav className="bg-gray-900 text-white"> <div className="max-w-screen-xl flex items-center justify-between mx-auto p-4"> <div className="flex items-center"> @@ -21,7 +21,19 @@ export default async function Home() { </div> </div> </nav> - <Guilds session={session} /> - </div> + <div className="flex"> + <div> + <div>Settings</div> + <Guilds session={session} /> + </div> + <div> + <h1 className="text-2xl">Logging</h1> + <h2>Channel 1</h2> + <h2>Channel 2</h2> + <h1 className="text-2xl">Quote of the Day</h1> + <h1 className="text-2xl">LLM Chatbot</h1> + </div> + </div> + </> ) } |
