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.

clean up guild overview & add miscs

Luna 265841fc 314c5bfd

+146 -223
-107
app/dashboard/[guildId]/miscellaneous/page.tsx
··· 1 - "use client"; 2 - 3 - import { useParams } from "next/navigation"; 4 - import { useEffect, useState } from "react"; 5 - import { HiViewGridAdd } from "react-icons/hi"; 6 - 7 - import { guildStore } from "@/common/guilds"; 8 - import SelectMenu from "@/components/inputs/select-menu"; 9 - import Switch from "@/components/inputs/switch"; 10 - import { ScreenMessage } from "@/components/screen-message"; 11 - import { ApiV1GuildsModulesEmbedmessagelinksGetResponse, RouteErrorResponse } from "@/typings"; 12 - 13 - export default function Home() { 14 - const guild = guildStore((g) => g); 15 - 16 - const [error, setError] = useState<string>(); 17 - const [eml, setEml] = useState<ApiV1GuildsModulesEmbedmessagelinksGetResponse>(); 18 - 19 - const params = useParams(); 20 - 21 - useEffect(() => { 22 - 23 - fetch(`${process.env.NEXT_PUBLIC_API}/guilds/${params.guildId}/modules/embed-message-links`, { 24 - credentials: "include" 25 - }) 26 - .then(async (res) => { 27 - const response = await res.json() as ApiV1GuildsModulesEmbedmessagelinksGetResponse; 28 - if (!response) return; 29 - 30 - switch (res.status) { 31 - case 200: { 32 - setEml(response); 33 - break; 34 - } 35 - default: { 36 - setEml(undefined); 37 - setError((response as unknown as RouteErrorResponse).message); 38 - break; 39 - } 40 - } 41 - 42 - }) 43 - .catch(() => { 44 - setError("Error while fetching miscellaneous data"); 45 - }); 46 - 47 - }, []); 48 - 49 - if (error) { 50 - return <> 51 - <ScreenMessage 52 - title="Something went wrong.." 53 - description={error} 54 - href={`/dashboard/${guild?.id}`} 55 - button="Go back to overview" 56 - icon={<HiViewGridAdd />} 57 - /> 58 - </>; 59 - } 60 - 61 - if (!eml) return <></>; 62 - 63 - return ( 64 - <div> 65 - 66 - <Switch 67 - name="Embed message links enabled." 68 - url={`/guilds/${guild?.id}/modules/embed-message-links`} 69 - dataName="enabled" 70 - defaultState={eml?.enabled || false} 71 - disabled={false} 72 - onSave={(s) => { 73 - eml.enabled = s; 74 - setEml({ ...eml }); 75 - }} 76 - /> 77 - 78 - <div className="lg:flex gap-3"> 79 - <div className="lg:w-1/2"> 80 - <SelectMenu 81 - name="Author Display Style" 82 - url={`/guilds/${guild?.id}/modules/embed-message-links`} 83 - dataName="display" 84 - items={[ 85 - { 86 - name: "Message Content", 87 - value: 0 88 - }, 89 - { 90 - name: "Embed Author (top)", 91 - value: 1 92 - }, 93 - { 94 - name: "Embed Footer (bottom)", 95 - value: 2 96 - } 97 - ]} 98 - description="Where the original message author shoud be displayed." 99 - defaultState={eml?.display} 100 - disabled={!eml.enabled} 101 - /> 102 - </div> 103 - </div> 104 - 105 - </div> 106 - ); 107 - }
+29 -114
app/dashboard/[guildId]/page.tsx
··· 1 1 "use client"; 2 2 3 - import { Accordion, AccordionItem } from "@nextui-org/react"; 4 - import Image from "next/image"; 5 - import Link from "next/link"; 6 3 import { useParams } from "next/navigation"; 7 - import { useCookies } from "next-client-cookies"; 8 4 import { HiChartBar } from "react-icons/hi"; 9 5 10 6 import { guildStore } from "@/common/guilds"; 11 - import NumberInput from "@/components/inputs/number-input"; 12 - import SelectMenu from "@/components/inputs/select-menu"; 13 7 import Switch from "@/components/inputs/switch"; 14 8 import { Section } from "@/components/section"; 15 9 16 10 import { OverviewLink } from "../../../components/overview-link"; 17 11 import FollowUpdates from "../updates.component"; 12 + import { TTSSettings } from "./tts.component"; 18 13 19 14 export default function Home() { 20 - const cookies = useCookies(); 21 15 const guild = guildStore((g) => g); 22 - 23 16 const params = useParams(); 24 17 25 - return ( 26 - <div> 18 + return (<> 19 + <OverviewLink 20 + title="View Leaderboard" 21 + message="Easily access and view the top chatters, voice timers, and inviters from this server in the web." 22 + url={`/leaderboard/${params.guildId}`} 23 + icon={<HiChartBar />} 24 + /> 27 25 28 - title="View Leaderboard" 29 - message="Easily access and view the top chatters, voice timers, and inviters from this server in the web." 30 - url={`/leaderboard/${params.guildId}`} 31 - icon={<HiChartBar />} 32 - /> 26 + <FollowUpdates /> 33 27 34 - <FollowUpdates /> 28 + <Section 29 + title="Text to Speech" 30 + > 31 + Let users to send messages to a channel and have wamellow read it out loud in voice chat. 32 + </Section> 35 33 36 - <Section 37 - title="Text to Speech" 38 - > 39 - Let users to send messages to a channel and have wamellow read it out loud in voice chat. 40 - </Section> 34 + <TTSSettings /> 41 35 42 - <div className="lg:flex gap-6 mt-5"> 43 - {guild?.tts && guild?.channels?.length && 44 - <div className="lg:w-1/2 space-y-6"> 45 - <SelectMenu 46 - name="Chat to Speech channel" 47 - url={`/guilds/${params.guildId}`} 48 - dataName="channelId" 49 - items={guild?.channels?.sort((a, b) => a.name.localeCompare(b.name)).map((c) => ({ name: `#${c.name}`, value: c.id, error: c.missingPermissions.filter((mp) => mp === "ViewChannel").join(", ") }))} 50 - description="Select a channel what channel should be used for tts." 51 - defaultState={guild?.tts.channelId} 52 - showClear 53 - /> 54 - <SelectMenu 55 - name="Usage logs" 56 - url={`/guilds/${params.guildId}`} 57 - dataName="logChannelId" 58 - items={guild?.channels?.sort((a, b) => a.name.localeCompare(b.name)).map((c) => ({ name: `#${c.name}`, value: c.id, error: c.missingPermissions.join(", ") }))} 59 - description="Select a channel where usage logs should be posted into." 60 - defaultState={guild?.tts.logChannelId} 61 - showClear 62 - /> 63 - <SelectMenu 64 - name="Priority role" 65 - url={`/guilds/${params.guildId}`} 66 - dataName="priorityRoleId" 67 - items={guild?.roles?.sort((a, b) => b.position - a.position).map((r) => ({ name: `@${r.name}`, value: r.id, color: r.color }))} 68 - description="People with this role bypass the queue and speak immediately." 69 - defaultState={guild?.tts.priorityRoleId} 70 - showClear 71 - /> 72 - <Switch 73 - name="Announce user" 74 - badge="Experimental" 75 - url={`/guilds/${params.guildId}`} 76 - dataName="announceUser" 77 - description="If I should say who is currently speaking via tts." 78 - defaultState={guild?.tts.announceUser || false} 79 - /> 80 - <NumberInput 81 - className="pt-7" 82 - name="Max message length" 83 - description="The maximum length of a message that can be spoken." 84 - url={`/guilds/${params.guildId}`} 85 - dataName="maxLength" 86 - defaultState={guild?.tts.maxLength || 4000} 87 - max={4000} 88 - /> 89 - </div> 90 - } 91 - <Accordion 92 - className="lg:w-1/2" 93 - defaultExpandedKeys={["1"]} 94 - disableAnimation={cookies.get("reduceMotions") === "true"} 95 - > 96 - <AccordionItem 97 - key="1" 98 - aria-label="how this works" 99 - title="How this works" 100 - > 101 - Users who are currently in a voice channel can send messages to this tts channel and wamellow will then read the message out loud in vc. Note that wamellow can only be in one voice channel at a time. 36 + <Section 37 + title="Miscs" 38 + > 39 + Small tools that improve chatting to insanity. 40 + </Section> 102 41 103 - <iframe 104 - className="mt-6 aspect-video rounded-lg" 105 - width={"100%"} 106 - src="https://www.youtube.com/embed/NS5fZ1ltovE?si=uODiGspuNGKPRQKp" 107 - title="Wamellow Text to Speech tutorial" 108 - allow="autoplay; clipboard-write; ENCRYPTION_TOKENed-media; picture-in-picture; web-share" 109 - /> 110 - </AccordionItem> 111 - <AccordionItem 112 - key="2" 113 - aria-label="how to blacklist users" 114 - title="How to blacklist users" 115 - > 116 - <div>Blacklist a user using discord channel permissions</div> 117 - <br /> 118 - <Link 119 - href="https://cdn.waya.one/r/YcU2CC.gif" 120 - target="_blank" 121 - > 122 - <Image 123 - alt="blacklist a user with discord channel permissions" 124 - className="rounded-md" 125 - height={945 / 2} 126 - src="https://cdn.waya.one/r/YcU2CC.gif" 127 - width={1040 / 2} 128 - /> 129 - </Link> 130 - </AccordionItem> 131 - </Accordion> 132 - </div> 42 + <Switch 43 + name="Embed message links" 44 + badge="Experimental" 45 + url={`/guilds/${params.guildId}`} 46 + dataName="tts.embedLinks" 47 + description="Reply with the original content of a message if a message link is sent." 48 + defaultState={guild?.embedLinks || false} 49 + /> 133 50 134 - </div> 135 - ); 136 - <OverviewLink 51 + </>); 137 52 }
+115
app/dashboard/[guildId]/tts.component.tsx
··· 1 + import { guildStore } from "@/common/guilds"; 2 + import NumberInput from "@/components/inputs/number-input"; 3 + import SelectMenu from "@/components/inputs/select-menu"; 4 + import Switch from "@/components/inputs/switch"; 5 + import { Accordion, AccordionItem } from "@nextui-org/react"; 6 + import { useCookies } from "next-client-cookies"; 7 + import Image from "next/image"; 8 + import Link from "next/link"; 9 + import { useParams } from "next/navigation"; 10 + 11 + export function TTSSettings() { 12 + const guild = guildStore((g) => g); 13 + const params = useParams(); 14 + 15 + return ( 16 + <div className="lg:flex gap-6 mt-5"> 17 + <div className="lg:w-1/2 space-y-6"> 18 + <SelectMenu 19 + name="Chat to Speech channel" 20 + url={`/guilds/${params.guildId}`} 21 + dataName="tts.channelId" 22 + items={guild?.channels?.sort((a, b) => a.name.localeCompare(b.name)).map((c) => ({ name: `#${c.name}`, value: c.id, error: c.missingPermissions.filter((mp) => mp === "ViewChannel").join(", ") }))} 23 + description="Select a channel what channel should be used for tts." 24 + defaultState={guild?.tts.channelId} 25 + showClear 26 + /> 27 + <SelectMenu 28 + name="Usage logs" 29 + url={`/guilds/${params.guildId}`} 30 + dataName="tts.logChannelId" 31 + items={guild?.channels?.sort((a, b) => a.name.localeCompare(b.name)).map((c) => ({ name: `#${c.name}`, value: c.id, error: c.missingPermissions.join(", ") }))} 32 + description="Select a channel where usage logs should be posted into." 33 + defaultState={guild?.tts.logChannelId} 34 + showClear 35 + /> 36 + <SelectMenu 37 + name="Priority role" 38 + url={`/guilds/${params.guildId}`} 39 + dataName="tts.priorityRoleId" 40 + items={guild?.roles?.sort((a, b) => b.position - a.position).map((r) => ({ name: `@${r.name}`, value: r.id, color: r.color }))} 41 + description="People with this role bypass the queue and speak immediately." 42 + defaultState={guild?.tts.priorityRoleId} 43 + showClear 44 + /> 45 + <Switch 46 + name="Announce user" 47 + badge="Experimental" 48 + url={`/guilds/${params.guildId}`} 49 + dataName="tts.announceUser" 50 + description="If I should say who is currently speaking via tts." 51 + defaultState={guild?.tts.announceUser || false} 52 + /> 53 + <NumberInput 54 + className="pt-7" 55 + name="Max message length" 56 + description="The maximum length of a message that can be spoken." 57 + url={`/guilds/${params.guildId}`} 58 + dataName="tts.maxLength" 59 + defaultState={guild?.tts.maxLength || 4000} 60 + max={4000} 61 + /> 62 + </div> 63 + 64 + <Faq /> 65 + </div> 66 + ) 67 + } 68 + 69 + function Faq() { 70 + const cookies = useCookies(); 71 + 72 + return ( 73 + <Accordion 74 + className="lg:w-1/2" 75 + defaultExpandedKeys={["1"]} 76 + disableAnimation={cookies.get("reduceMotions") === "true"} 77 + > 78 + <AccordionItem 79 + key="1" 80 + aria-label="how this works" 81 + title="How this works" 82 + > 83 + Users who are currently in a voice channel can send messages to this tts channel and wamellow will then read the message out loud in vc. Note that wamellow can only be in one voice channel at a time. 84 + 85 + <iframe 86 + className="mt-6 aspect-video rounded-lg" 87 + width="100%" 88 + src="https://www.youtube.com/embed/NS5fZ1ltovE?si=uODiGspuNGKPRQKp" 89 + title="Wamellow Text to Speech tutorial" 90 + allow="autoplay; clipboard-write; ENCRYPTION_TOKENed-media; picture-in-picture; web-share" 91 + /> 92 + </AccordionItem> 93 + <AccordionItem 94 + key="2" 95 + aria-label="how to blacklist users" 96 + title="How to blacklist users" 97 + > 98 + <div>Blacklist a user using discord channel permissions</div> 99 + <br /> 100 + <Link 101 + href="https://cdn.waya.one/r/YcU2CC.gif" 102 + target="_blank" 103 + > 104 + <Image 105 + alt="blacklist a user with discord channel permissions" 106 + className="rounded-md" 107 + height={945 / 2} 108 + src="https://cdn.waya.one/r/YcU2CC.gif" 109 + width={1040 / 2} 110 + /> 111 + </Link> 112 + </AccordionItem> 113 + </Accordion> 114 + ) 115 + }
-1
app/dashboard/updates.component.tsx
··· 7 7 import SelectMenu from "@/components/inputs/select-menu"; 8 8 import Modal from "@/components/modal"; 9 9 10 - 11 10 export default function FollowUpdates() { 12 11 const guild = guildStore((g) => g); 13 12
+2 -1
typings.ts
··· 45 45 logChannelId: string | null; 46 46 priorityRoleId: string | null; 47 47 maxLength?: number | null; 48 - } 48 + }; 49 + embedLinks: boolean; 49 50 } 50 51 51 52 export interface ApiV1GuildsTopmembersGetResponse {