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.

automatically generate `faciron.ico`

Luna 9f1faf3f a2b6c544

+40
+40
app/(dynamic-assets)/favicon.ico/route.ts
··· 1 + import { getUser } from "@/lib/discord/user"; 2 + import sharp from "sharp"; 3 + 4 + export async function GET() { 5 + const user = await getUser(process.env.CLIENT_ID!); 6 + 7 + const avatar = await fetch(user?.avatarUrl 8 + ? user.avatarUrl + "?size=64" 9 + : "https://cdn.discordapp.com/embed/avatars/5.png" 10 + ) 11 + .then(r => r.arrayBuffer()) 12 + 13 + const { data, info } = await sharp(Buffer.from(avatar)) 14 + .resize(64, 64) 15 + .toBuffer({ resolveWithObject: true }); 16 + 17 + const svgCircle = ` 18 + <svg width="${info.width}" height="${info.height}" xmlns="http://www.w3.org/2000/svg"> 19 + <circle cx="${info.width / 2}" cy="${info.height / 2}" r="${info.width / 2}" fill="white"/> 20 + </svg> 21 + `; 22 + 23 + const icon = await sharp(data) 24 + .composite([{ 25 + input: Buffer.from(svgCircle), 26 + blend: 'dest-in' 27 + }]) 28 + .toFormat("png") 29 + .toBuffer(); 30 + 31 + // does anything even care if it's an actual x-icon lol 32 + return new Response( 33 + icon, 34 + { 35 + headers: { 36 + 'Content-Type': 'image/png' 37 + } 38 + } 39 + ) 40 + }
app/favicon.ico

This is a binary file and will not be displayed.