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.

embed creator fix footer

Luna 5b73c1f8 6e47baf8

+43 -10
+38 -9
components/discord/message-embed.tsx
··· 1 - import React, { FunctionComponent } from "react"; 1 + import React from "react"; 2 2 3 3 import cn from "@/utils/cn"; 4 4 ··· 7 7 interface Props { 8 8 children: React.ReactNode; 9 9 mode: "DARK" | "LIGHT"; 10 - classname?: string; 10 + className?: string; 11 11 12 12 author?: { 13 13 icon_url?: string; ··· 27 27 28 28 export default function DiscordMessageEmbed({ 29 29 children, 30 - classname, 30 + className, 31 31 author, 32 32 title, 33 33 color, ··· 39 39 if (!title && !image && !footer?.text && (!children || children.toString() === ",false")) return <></>; 40 40 41 41 return ( 42 - <div className={cn("w-full font-light p-3 rounded border-l-4", mode === "DARK" ? "text-neutral-200" : "text-neutral-800", classname)} style={{ backgroundColor: mode === "DARK" ? "rgb(40, 42, 46)" : "rgb(242, 243, 245)", borderLeftColor: `#${color?.toString(16)}` }}> 42 + <div 43 + className={cn( 44 + "w-full font-light p-3 rounded border-l-4", 45 + mode === "DARK" ? "text-neutral-200" : "text-neutral-800", 46 + className 47 + )} 48 + style={{ 49 + backgroundColor: mode === "DARK" ? "rgb(40, 42, 46)" : "rgb(242, 243, 245)", 50 + borderLeftColor: `#${color?.toString(16)}` 51 + }} 52 + > 43 53 44 54 <div className="flex w-full max-w-full"> 45 55 <div className={thumbnail ? "w-9/12" : "w-full"}> 46 56 {author && 47 - <div className={`${mode === "DARK" ? "text-neutral-100" : "text-neutral-900"} font-semibold text-semibold mb-2 flex gap-2 items-center`}> 57 + <div 58 + className={cn( 59 + mode === "DARK" ? "text-neutral-100" : "text-neutral-900", 60 + "font-semibold text-semibold mb-2 flex gap-2 items-center" 61 + )} 62 + > 48 63 {/* eslint-disable-next-line @next/next/no-img-element */} 49 64 {author.icon_url && <img src={author.icon_url} alt="" className="rounded-full h-6 w-6" />} 50 - <Highlight mode={mode} text={author.text} discord={false} /> 65 + <Highlight 66 + mode={mode} 67 + text={author.text} 68 + discord={false} 69 + /> 51 70 </div> 52 71 } 53 72 {title && 54 - <div className={`${mode === "DARK" ? "text-neutral-100" : "text-neutral-900"} font-semibold text-lg mb-2`}> 55 - <Highlight mode={mode} text={title} discord={false} /> 73 + <div 74 + className={cn( 75 + mode === "DARK" ? "text-neutral-100" : "text-neutral-900", 76 + "font-semibold text-lg mb-2" 77 + )} 78 + > 79 + <Highlight 80 + mode={mode} 81 + text={title} 82 + discord={false} 83 + /> 56 84 </div> 57 85 } 58 86 <div className="text-sm"> 59 87 {children} 60 88 </div> 61 89 </div> 90 + 62 91 {/* eslint-disable-next-line @next/next/no-img-element */} 63 92 {thumbnail && <img src={thumbnail} alt="" className="ml-auto h-20 w-20 rounded-md" />} 64 93 </div> ··· 78 107 79 108 </div> 80 109 ); 81 - }; 110 + }
+5 -1
components/embed-creator.tsx
··· 98 98 content, 99 99 embed: Object.assign( 100 100 JSON.parse(embed), 101 - embedfooter.length > 2 ? { footer: JSON.parse(embedfooter) } : {} 101 + embedfooter.length 102 + ? { footer: JSON.parse(embedfooter) } 103 + : undefined 102 104 ) 103 105 }; 106 + 107 + if (!body.embed.footer.text) body.embed.footer = { text: null }; 104 108 105 109 const res = await fetch(`${process.env.NEXT_PUBLIC_API}${url}`, { 106 110 method: "PATCH",