The weeb for the next gen discord boat - Wamellow wamellow.com
bot discord
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

small refactors

Luna 3bd5cf7c 7076aa08

+12 -6
+4 -4
app/leaderboard/[guildId]/page.tsx
··· 1 1 import { cookies } from "next/headers"; 2 2 import Image from "next/image"; 3 + import { redirect } from "next/navigation"; 3 4 4 5 import { AddButton, HomeButton, ScreenMessage, SupportButton } from "@/components/screen-message"; 5 6 import { getGuild } from "@/lib/api"; 6 7 import SadWumpusPic from "@/public/sad-wumpus.gif"; 7 8 8 9 import { getDesign, getPagination, getTopMembers } from "./api"; 10 + import Member from "./member.component"; 9 11 import Pagination from "./pagination.component"; 10 - import { redirect } from "next/navigation"; 11 - import Member from "./member.component"; 12 12 13 - export const revalidate = 60 * 60; 13 + export const revalidate = 3600; 14 14 15 15 export default async function Home({ 16 16 params, ··· 24 24 if (searchParams) searchParams.type ||= "messages"; 25 25 const page = parseInt(searchParams.page || "1"); 26 26 27 - if (page !== 1 && !cookieStore.get("hasSession")) redirect("/login?callback=/leaderboard/%5BguildId%5D/messages%3Fpage=" + page) 27 + if (page !== 1 && !cookieStore.get("hasSession")) redirect("/login?callback=/leaderboard/%5BguildId%5D/messages%3Fpage=" + page); 28 28 29 29 const guildPromise = getGuild(params.guildId); 30 30 const membersPromise = getTopMembers(params.guildId, { page, type: searchParams.type });
+5 -1
app/login/api.ts
··· 1 1 import { User } from "@/common/user"; 2 2 import { RouteErrorResponse } from "@/typings"; 3 3 4 - export async function createSession(code: string, session?: string): Promise<User | RouteErrorResponse | undefined> { 4 + interface UserSessionCreate extends User { 5 + session: string; 6 + } 7 + 8 + export async function createSession(code: string, session?: string): Promise<UserSessionCreate | RouteErrorResponse | undefined> { 5 9 6 10 const headers: Record<string, string> = { 7 11 "Content-Type": "application/json",
+3 -1
utils/average-color.ts
··· 21 21 let blueSum = 0; 22 22 23 23 for (let i = 0; i < data.length; i += 4) { 24 + if ((data[i] + data[i + 1] + data[1 + 2]) < 10) continue; 25 + 24 26 redSum += data[i]; 25 27 greenSum += data[i + 1]; 26 28 blueSum += data[i + 2]; ··· 32 34 b: Math.round(blueSum / pixelCount) 33 35 }; 34 36 35 - const hex = `#${rgb.r.toString(16).padStart(2, "0")}${rgb.g.toString(16).padStart(2, "0")}${rgb.b.toString(16).padStart(2, "0")}` 37 + const hex = `#${rgb.r.toString(16).padStart(2, "0")}${rgb.g.toString(16).padStart(2, "0")}${rgb.b.toString(16).padStart(2, "0")}`; 36 38 cache.set(url, hex); 37 39 38 40 return hex;