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.

replace Lorem Ipsum with member count

Luna 62e8bb87 0e2848aa

+10 -6
+2 -1
app/dashboard/[guildId]/layout.tsx
··· 20 20 const [error, setError] = useState<string>(); 21 21 22 22 const params = useParams(); 23 + const intl = new Intl.NumberFormat("en", { notation: "standard" }); 23 24 24 25 useEffect(() => { 25 26 ··· 170 171 <Image src={guild?.icon ? `https://cdn.discordapp.com/icons/${guild.id}/${guild.icon}.webp?size=64` : "https://cdn.waya.one/r/discord.png"} width={64} height={64} alt="Server" className="rounded-full h-14 w-14 mr-3" /> 171 172 <div> 172 173 <div className="text-xl dark:text-neutral-200 text-neutral-800 font-medium">{guild?.name || "Unknown Server"}</div> 173 - <div className="text-sm">Lorem ipsum</div> 174 + <div className="text-sm">{intl.format(guild?.memberCount || 0)} members</div> 174 175 </div> 175 176 </div> 176 177
+5 -5
app/leaderboard/[guildId]/page.tsx
··· 80 80 const membersPromise = getTopMembers(params.guildId, { page: parseInt(searchParams.page || "0"), type: searchParams.type }); 81 81 const designPromise = getDesign(params.guildId); 82 82 83 - const [guild, members, design] = await Promise.all([guildPromise, membersPromise, designPromise]); 83 + const [guild, members, design] = await Promise.all([guildPromise, membersPromise, designPromise]).catch(() => []); 84 84 85 - const backgroundRgb = decimalToRgb(design.backgroundColor || 0); 85 + const backgroundRgb = decimalToRgb(design?.backgroundColor || 0); 86 86 const intl = new Intl.NumberFormat("en", { notation: "standard" }); 87 87 88 88 return ( ··· 109 109 <Image src={guild?.icon ? `https://cdn.discordapp.com/icons/${guild.id}/${guild.icon}.webp?size=64` : "https://cdn.waya.one/r/discord.png"} width={64} height={64} alt="Server" className="rounded-full h-14 w-14 mr-3" /> 110 110 <div> 111 111 <div className="text-xl dark:text-neutral-200 text-neutral-800 font-medium">{guild?.name || "Unknown Server"}</div> 112 - <div className="text-sm">Lorem ipsum</div> 112 + <div className="text-sm">{intl.format(guild?.memberCount || 0)} members</div> 113 113 </div> 114 114 </div> 115 115 </div> ··· 138 138 139 139 <div className="md:w-3/4 md:mr-6"> 140 140 { 141 - !searchParams.type || searchParams.type === "voiceminutes" || searchParams.type === "invites" ? 141 + (guild && !("statusCode" in guild) && (!searchParams.type || searchParams.type === "voiceminutes" || searchParams.type === "invites")) ? 142 142 (members || []).sort((a, b) => (b?.activity?.[searchParams.type as Types] ?? 0) - (a?.activity?.[searchParams.type as Types] ?? 0)).map((member) => 143 143 <div 144 144 key={member.id} ··· 173 173 ) 174 174 : 175 175 <ErrorBanner 176 - message="Invalid leaderboard type" 176 + message={(!guild || "statusCode" in guild) ? "Not Found" : "Invalid leaderboard type"} 177 177 /> 178 178 } 179 179
+3
typings.ts
··· 25 25 id: string; 26 26 name: string; 27 27 icon: string | null; 28 + memberCount: number; 29 + channelCount: number; 30 + premiumTier: number; 28 31 } 29 32 30 33 export interface ApiV1GuildsTopmembersGetResponse {