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.

rename component defaults

Luna a687fd2d ff78f9bc

+58 -48
+2 -2
app/dashboard/[guildId]/greeting/bye/page.tsx
··· 98 98 dataName="channelId" 99 99 items={guild?.channels?.sort((a, b) => a.name.localeCompare(b.name)).map((c) => { return { name: `#${c.name}`, value: c.id, error: c.missingPermissions.join(", ") }; })} 100 100 description="Select the channel where the bye message should be send into." 101 - __defaultState={bye?.channelId} 101 + defaultState={bye?.channelId} 102 102 disabled={!bye.enabled} 103 103 /> 104 104 ··· 200 200 ratio="aspect-[4/1]" 201 201 dataName="card.background" 202 202 description="Enter a url which should be the background for the image card. The recomended image ration is 4:1 and recommended resolution 1024x256px." 203 - __defaultState={bye.card.background || ""} 203 + defaultState={bye.card.background || ""} 204 204 disabled={!bye.card.enabled || !bye.enabled} 205 205 onSave={(v) => { 206 206 setBye({
+6 -6
app/dashboard/[guildId]/greeting/passport/page.tsx
··· 105 105 dataName="channelId" 106 106 items={guild?.channels?.sort((a, b) => a.name.localeCompare(b.name)).map((c) => { return { name: `#${c.name}`, value: c.id, error: c.missingPermissions.join(", ") }; })} 107 107 description="Select the channel where verifications should be send into." 108 - __defaultState={passport?.channelId} 108 + defaultState={passport?.channelId} 109 109 disabled={!passport.enabled} 110 110 /> 111 111 ··· 117 117 dataName="unverifiedRoleId" 118 118 items={guild?.roles?.sort((a, b) => a.name.localeCompare(b.name)).map((c) => { return { name: `#${c.name}`, value: c.id, error: c.missingPermissions.join(", ") }; })} 119 119 description="Select what role members should get when joining." 120 - __defaultState={passport?.unverifiedRoleId} 120 + defaultState={passport?.unverifiedRoleId} 121 121 disabled={!passport.enabled} 122 122 /> 123 123 </div> ··· 129 129 dataName="successRoleId" 130 130 items={guild?.roles?.sort((a, b) => a.name.localeCompare(b.name)).map((c) => { return { name: `#${c.name}`, value: c.id, error: c.missingPermissions.join(", ") }; })} 131 131 description="Select what role members should get when completing verification." 132 - __defaultState={passport?.successRoleId} 132 + defaultState={passport?.successRoleId} 133 133 disabled={!passport.enabled} 134 134 /> 135 135 </div> ··· 147 147 { name: "Assign role to member", value: 2 } 148 148 ]} 149 149 description="Choose what should happen if a member failes verification." 150 - __defaultState={passport?.punishment} 150 + defaultState={passport?.punishment} 151 151 disabled={!passport.enabled} 152 152 onSave={(o) => { 153 153 ··· 188 188 dataName="punishmentRoleId" 189 189 items={guild?.roles?.sort((a, b) => b.position - a.position).map((r) => { return { name: `@${r.name}`, value: r.id, error: r.missingPermissions.join(", "), color: r.color }; })} 190 190 description="Select what role members should get when failing verification." 191 - __defaultState={passport.punishmentRoleId} 191 + defaultState={passport.punishmentRoleId} 192 192 onSave={(o) => { 193 193 setPunishmentRoleId(o.value as string); 194 194 }} ··· 202 202 dataName="punishmentRoleId" 203 203 items={guild?.roles?.sort((a, b) => a.name.localeCompare(b.name)).map((c) => { return { name: `#${c.name}`, value: c.id, error: c.missingPermissions.filter((mp) => mp !== "EmbedLinks").join(", ") }; })} 204 204 description="Select what role members should get when failing verification." 205 - __defaultState={passport?.punishmentRoleId} 205 + defaultState={passport?.punishmentRoleId} 206 206 disabled={!passport.enabled || passport.punishment !== 2} 207 207 onSave={(o) => { 208 208 setPassport({
+6 -6
app/dashboard/[guildId]/greeting/welcome/page.tsx
··· 107 107 dataName="channelId" 108 108 items={guild?.channels?.sort((a, b) => a.name.localeCompare(b.name)).map((c) => { return { name: `#${c.name}`, value: c.id, error: c.missingPermissions.join(", ") }; })} 109 109 description="Select the channel where the welcome message should be send into." 110 - __defaultState={welcome?.channelId} 110 + defaultState={welcome?.channelId} 111 111 disabled={!welcome.enabled || false} 112 112 /> 113 113 ··· 164 164 dataName="roleIds" 165 165 items={guild?.roles?.sort((a, b) => b.position - a.position).map((r) => { return { name: `@${r.name}`, value: r.id, error: r.missingPermissions.join(", "), color: r.color }; })} 166 166 description="Select roles which members should get." 167 - __defaultState={welcome?.roleIds || []} 167 + defaultState={welcome?.roleIds || []} 168 168 max={5} 169 169 disabled={!welcome.enabled} 170 170 /> ··· 177 177 dataName="pingIds" 178 178 items={guild?.channels?.sort((a, b) => a.name.localeCompare(b.name)).map((c) => { return { name: `#${c.name}`, value: c.id, error: c.missingPermissions.filter((mp) => mp !== "EmbedLinks").join(", ") }; })} 179 179 description="Select in what channels user should get ghostpinged." 180 - __defaultState={welcome?.pingIds || []} 180 + defaultState={welcome?.pingIds || []} 181 181 max={5} 182 182 disabled={!welcome.enabled} 183 183 /> ··· 198 198 }) || [] 199 199 ]} 200 200 description="Select emotes which will be reacted with on members first message." 201 - __defaultState={welcome?.reactions?.firstMessageEmojis} 201 + defaultState={welcome?.reactions?.firstMessageEmojis} 202 202 max={2} 203 203 disabled={!welcome.enabled} 204 204 /> ··· 217 217 }) || [] 218 218 ]} 219 219 description="Select emotes which will be reacted with on welcome messages." 220 - __defaultState={welcome?.reactions?.welcomeMessageEmojis} 220 + defaultState={welcome?.reactions?.welcomeMessageEmojis} 221 221 max={2} 222 222 disabled={!welcome.enabled} 223 223 /> ··· 278 278 ratio="aspect-[4/1]" 279 279 dataName="card.background" 280 280 description="Enter a url which should be the background for the image card. The recomended image ration is 4:1 and recommended resolution 1024x256px." 281 - __defaultState={welcome.card.background || ""} 281 + defaultState={welcome.card.background || ""} 282 282 disabled={!welcome.card.enabled || !welcome.enabled} 283 283 onSave={(v) => { 284 284 setWelcome({
+1 -1
app/dashboard/[guildId]/page.tsx
··· 83 83 dataName="channelId" 84 84 items={guild?.channels?.sort((a, b) => a.name.localeCompare(b.name)).map((c) => { return { name: `#${c.name}`, value: c.id }; })} 85 85 description="Select a channel where updates should be send into." 86 - __defaultState={guild?.follownewsChannel?.id} 86 + defaultState={guild?.follownewsChannel?.id} 87 87 onSave={(o) => { 88 88 setFollowchannel(o.value as string); 89 89 }}
+5 -5
app/dashboard/[guildId]/starboard/page.tsx
··· 200 200 dataName="channelId" 201 201 items={guild?.channels?.sort((a, b) => a.name.localeCompare(b.name)).map((c) => { return { name: `#${c.name}`, value: c.id, error: c.missingPermissions.join(", ") }; })} 202 202 description="Select the channel where the starboard messages should be send into." 203 - __defaultState={starboard?.channelId} 203 + defaultState={starboard?.channelId} 204 204 disabled={!starboard.enabled} 205 205 /> 206 206 ··· 218 218 }) || [] 219 219 ]} 220 220 description="Select the emoji that needs to be reacted with." 221 - __defaultState={starboard?.emoji} 221 + defaultState={starboard?.emoji} 222 222 disabled={!starboard.enabled} 223 223 /> 224 224 </div> ··· 247 247 } 248 248 ]} 249 249 description="The style members profile gets displayed." 250 - __defaultState={starboard?.style} 250 + defaultState={starboard?.style} 251 251 onSave={(options) => handleUserStyle(options.value as number)} 252 252 disabled={!starboard.enabled} 253 253 /> ··· 262 262 dataName="blacklistRoleIds" 263 263 items={guild?.roles?.sort((a, b) => b.position - a.position).map((r) => { return { name: `@${r.name}`, value: r.id, color: r.color }; })} 264 264 description="Select roles which should not be able to starboard." 265 - __defaultState={starboard?.blacklistRoleIds || []} 265 + defaultState={starboard?.blacklistRoleIds || []} 266 266 max={500} 267 267 disabled={!starboard.enabled} 268 268 /> ··· 275 275 dataName="blacklistChannelIds" 276 276 items={guild?.channels?.sort((a, b) => a.name.localeCompare(b.name)).map((c) => { return { name: `#${c.name}`, value: c.id }; })} 277 277 description="Select channels which should not be able to be in the starboard." 278 - __defaultState={starboard?.blacklistChannelIds || []} 278 + defaultState={starboard?.blacklistChannelIds || []} 279 279 max={500} 280 280 disabled={!starboard.enabled} 281 281 />
+4 -4
app/profile/rank/page.tsx
··· 44 44 error: "Not done yet" 45 45 } 46 46 ]} 47 - __defaultState={user?.extended?.rank?.subText?.type?.toString()} 47 + defaultState={user?.extended?.rank?.subText?.type?.toString()} 48 48 onSave={(options) => { 49 49 if (!user) return; 50 50 userStore.setState(deepMerge<User>(user, { extended: { rank: { subText: { type: Number(options.value) as 0 | 1 | 2 | 3 } } } })); ··· 62 62 dataName="textColor" 63 63 description="Color used for your username." 64 64 type="color" 65 - __defaultState={user?.extended?.rank?.textColor ?? 0} 65 + defaultState={user?.extended?.rank?.textColor ?? 0} 66 66 onSave={(value) => { 67 67 if (!user) return; 68 68 userStore.setState(deepMerge<User>(user, { extended: { rank: { textColor: Number(value) } } })); ··· 78 78 dataName="barColor" 79 79 description="Color used for the progress bar." 80 80 type="color" 81 - __defaultState={user?.extended?.rank?.barColor ?? 0} 81 + defaultState={user?.extended?.rank?.barColor ?? 0} 82 82 onSave={(value) => { 83 83 if (!user) return; 84 84 userStore.setState(deepMerge<User>(user, { extended: { rank: { barColor: Number(value) } } })); ··· 95 95 ratio="aspect-[4/1]" 96 96 dataName="background" 97 97 description="Enter a url which should be the background of your /rank card. The recomended image ration is 4:1 and recommended resolution 1024x256px." 98 - __defaultState={user?.extended?.rank?.background || ""} 98 + defaultState={user?.extended?.rank?.background || ""} 99 99 onSave={(value) => { 100 100 if (!user) return; 101 101 userStore.setState(deepMerge<User>(user, { extended: { rank: { background: value } } }));
+8 -8
components/inputs/ImageUrlInput.tsx
··· 11 11 dataName: string; 12 12 disabled?: boolean; 13 13 description?: string; 14 - __defaultState: string; 14 + defaultState: string; 15 15 ratio: `aspect-[${number}/${number}]` 16 16 17 17 onSave?: (value: string) => void; 18 18 }; 19 19 20 20 21 - const ImageUrlInput: FunctionComponent<Props> = ({ name, url, dataName, disabled, description, __defaultState, onSave, ratio }) => { 21 + const ImageUrlInput: FunctionComponent<Props> = ({ name, url, dataName, disabled, description, defaultState, onSave, ratio }) => { 22 22 const [state, setState] = useState<"LOADING" | "ERRORED" | "SUCCESS" | undefined>(); 23 23 const [error, setError] = useState<string>(); 24 24 25 25 const [value, setValue] = useState<string>(""); 26 - const [__defaultStatealue, set__defaultStatealue] = useState<string>(""); 26 + const [defaultStatealue, setdefaultStatealue] = useState<string>(""); 27 27 const [imagestate, setImagestate] = useState<"ERRORED" | "SUCCESS" | undefined>(undefined); 28 28 29 29 useEffect(() => { 30 - if (!__defaultStatealue) set__defaultStatealue(__defaultState); 31 - setValue(__defaultState); 32 - }, [__defaultState]); 30 + if (!defaultStatealue) setdefaultStatealue(defaultState); 31 + setValue(defaultState); 32 + }, [defaultState]); 33 33 34 34 useEffect(() => { 35 35 if (!value?.length) setImagestate("SUCCESS"); ··· 37 37 }, [value]); 38 38 39 39 useEffect(() => { 40 - if (imagestate !== "SUCCESS" || __defaultStatealue === value) return; 40 + if (imagestate !== "SUCCESS" || defaultStatealue === value) return; 41 41 setError(undefined); 42 42 setState("LOADING"); 43 43 ··· 60 60 switch (res.status) { 61 61 case 200: { 62 62 setValue(value); 63 - set__defaultStatealue(value); 63 + setdefaultStatealue(value); 64 64 onSave?.(value); 65 65 66 66 setState("SUCCESS");
+11 -9
components/inputs/MultiSelectMenu.tsx
··· 7 7 import { truncate } from "@/utils/truncate"; 8 8 9 9 type Props = { 10 + className?: string; 11 + 10 12 name: string; 11 13 url: string; 12 14 dataName: string; ··· 14 16 disabled?: boolean; 15 17 max?: number; 16 18 description?: string; 17 - __defaultState?: string[]; 19 + defaultState?: string[]; 18 20 }; 19 21 20 22 21 - const MultiSelectMenu: FunctionComponent<Props> = ({ name, url, dataName, items = [], disabled, max = Infinity, description, __defaultState = [] }) => { 23 + const MultiSelectMenu: FunctionComponent<Props> = ({ className, name, url, dataName, items = [], disabled, max = Infinity, description, defaultState = [] }) => { 22 24 const web = webStore((w) => w); 23 25 24 26 const [state, setState] = useState<"LOADING" | "ERRORED" | "SUCCESS" | undefined>(); 25 27 const [error, setError] = useState<string>(); 26 28 27 29 const [open, setOpen] = useState<boolean>(false); 28 - const [defaultvalue, setDefaultalue] = useState<string[]>([]); 30 + const [_defaultvalue, _setDefaultalue] = useState<string[]>([]); 29 31 const [values, setValues] = useState<{ icon?: React.ReactNode; name: string; value: string; error?: string; color?: number; }[]>([]); 30 32 31 33 useEffect(() => { 32 - setValues(items.filter((i) => __defaultState?.includes(i.value))); 33 - setDefaultalue(__defaultState); 34 - }, [__defaultState]); 34 + setValues(items.filter((i) => defaultState?.includes(i.value))); 35 + _setDefaultalue(defaultState); 36 + }, [defaultState]); 35 37 36 38 useEffect(() => { 37 39 setError(undefined); 38 - if (open || values.find((v) => !!v.error) || JSON.stringify(values.map((v) => v.value)) === JSON.stringify(defaultvalue)) { 40 + if (open || values.find((v) => !!v.error) || JSON.stringify(values.map((v) => v.value)) === JSON.stringify(_defaultvalue)) { 39 41 setState(undefined); 40 42 return; 41 43 } ··· 79 81 }, [open]); 80 82 81 83 return ( 82 - <div className="select-none w-full max-w-full mb-3 relative"> 84 + <div className={"select-none w-full max-w-full mb-3 relative " + className}> 83 85 <div className="flex items-center gap-2"> 84 86 <span className="text-lg dark:text-neutral-300 text-neutral-700 font-medium">{name}</span> 85 87 {state === "LOADING" && <TailSpin stroke="#d4d4d4" strokeWidth={8} className="relative h-3 w-3 overflow-visible" />} ··· 89 91 className={`mt-1 min-h-12 w-full dark:bg-wamellow bg-wamellow-100 rounded-md flex items-center px-3 ${open && "outline outline-violet-400 outline-2"} ${(values.find((v) => !!v.error) || error || state === "ERRORED") && !open && "outline outline-red-500 outline-1"} ${state === "SUCCESS" && !open && "outline outline-green-500 outline-1"} ${(state === "LOADING" || disabled) && "cursor-not-allowed opacity-50"}`} 90 92 onClick={() => { 91 93 setOpen(!open); 92 - if (!open) setDefaultalue(values.map((v) => v.value)); 94 + if (!open) _setDefaultalue(values.map((v) => v.value)); 93 95 }} 94 96 disabled={(state === "LOADING" || disabled)} 95 97 >
+9 -7
components/inputs/NumberInput.tsx
··· 7 7 8 8 9 9 type Props = { 10 + className?: string; 11 + 10 12 name: string; 11 13 url: string; 12 14 dataName: string; ··· 18 20 }; 19 21 20 22 21 - const NumberInput: FunctionComponent<Props> = ({ name, url, dataName, disabled, description, defaultState, min = 0 }) => { 23 + const NumberInput: FunctionComponent<Props> = ({ className, name, url, dataName, disabled, description, defaultState, min = 0 }) => { 22 24 const web = webStore((w) => w); 23 25 24 26 const [state, setState] = useState<"LOADING" | "ERRORED" | "SUCCESS" | undefined>(); ··· 28 30 const intervalRef = useRef<NodeJS.Timeout | null>(null); 29 31 30 32 const [value, setValue] = useState<number>(); 31 - const [__defaultStatealue, setDefaultalue] = useState<number>(); 33 + const [defaultStatealue, _setDefaultalue] = useState<number>(); 32 34 33 35 useEffect(() => { 34 36 if (!hold) { ··· 49 51 50 52 useEffect(() => { 51 53 setValue(defaultState); 52 - setDefaultalue(defaultState); 54 + _setDefaultalue(defaultState); 53 55 }, [defaultState]); 54 56 55 57 function handleSave() { 56 - if (__defaultStatealue === value) return; 58 + if (defaultStatealue === value) return; 57 59 setError(undefined); 58 60 setState("LOADING"); 59 61 ··· 76 78 switch (res.status) { 77 79 case 200: { 78 80 setState("SUCCESS"); 79 - setDefaultalue(value); 81 + _setDefaultalue(value); 80 82 setTimeout(() => setState(undefined), 1_000 * 8); 81 83 break; 82 84 } ··· 95 97 } 96 98 97 99 return ( 98 - <div className="relative"> 100 + <div className={"relative " + className}> 99 101 <div className="flex items-center mb-6"> 100 102 <div> 101 103 <div className="flex gap-2"> ··· 108 110 109 111 <div className={`ml-auto relative flex items-center cursor-pointer h-8 ${(disabled || (state === "LOADING" || disabled)) && "opacity-50"}`}> 110 112 111 - {__defaultStatealue !== value && 113 + {defaultStatealue !== value && 112 114 <button 113 115 onClick={handleSave} 114 116 className={`bg-violet-600 hover:bg-violet-600/80 duration-200 h-full w-12 rounded-md mr-2 ${(state === "LOADING" || disabled) ? "cursor-not-allowed" : "cursor-pointer"}`}
+6
next.config.js
··· 17 17 hostname: "cdn.waya.one", 18 18 port: "", 19 19 pathname: "/r/**" 20 + }, 21 + { 22 + protocol: "https", 23 + hostname: "image-api.wamellow.com", 24 + port: "", 25 + pathname: "/" 20 26 } 21 27 ] 22 28 }