···11"use client";
2233-import { Accordion, AccordionItem } from "@nextui-org/react";
44-import Image from "next/image";
55-import Link from "next/link";
63import { useParams } from "next/navigation";
77-import { useCookies } from "next-client-cookies";
84import { HiChartBar } from "react-icons/hi";
95106import { guildStore } from "@/common/guilds";
1111-import NumberInput from "@/components/inputs/number-input";
1212-import SelectMenu from "@/components/inputs/select-menu";
137import Switch from "@/components/inputs/switch";
148import { Section } from "@/components/section";
1591610import { OverviewLink } from "../../../components/overview-link";
1711import FollowUpdates from "../updates.component";
1212+import { TTSSettings } from "./tts.component";
18131914export default function Home() {
2020- const cookies = useCookies();
2115 const guild = guildStore((g) => g);
2222-2316 const params = useParams();
24172525- return (
2626- <div>
1818+ return (<>
1919+ <OverviewLink
2020+ title="View Leaderboard"
2121+ message="Easily access and view the top chatters, voice timers, and inviters from this server in the web."
2222+ url={`/leaderboard/${params.guildId}`}
2323+ icon={<HiChartBar />}
2424+ />
27252828- title="View Leaderboard"
2929- message="Easily access and view the top chatters, voice timers, and inviters from this server in the web."
3030- url={`/leaderboard/${params.guildId}`}
3131- icon={<HiChartBar />}
3232- />
2626+ <FollowUpdates />
33273434- <FollowUpdates />
2828+ <Section
2929+ title="Text to Speech"
3030+ >
3131+ Let users to send messages to a channel and have wamellow read it out loud in voice chat.
3232+ </Section>
35333636- <Section
3737- title="Text to Speech"
3838- >
3939- Let users to send messages to a channel and have wamellow read it out loud in voice chat.
4040- </Section>
3434+ <TTSSettings />
41354242- <div className="lg:flex gap-6 mt-5">
4343- {guild?.tts && guild?.channels?.length &&
4444- <div className="lg:w-1/2 space-y-6">
4545- <SelectMenu
4646- name="Chat to Speech channel"
4747- url={`/guilds/${params.guildId}`}
4848- dataName="channelId"
4949- 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(", ") }))}
5050- description="Select a channel what channel should be used for tts."
5151- defaultState={guild?.tts.channelId}
5252- showClear
5353- />
5454- <SelectMenu
5555- name="Usage logs"
5656- url={`/guilds/${params.guildId}`}
5757- dataName="logChannelId"
5858- items={guild?.channels?.sort((a, b) => a.name.localeCompare(b.name)).map((c) => ({ name: `#${c.name}`, value: c.id, error: c.missingPermissions.join(", ") }))}
5959- description="Select a channel where usage logs should be posted into."
6060- defaultState={guild?.tts.logChannelId}
6161- showClear
6262- />
6363- <SelectMenu
6464- name="Priority role"
6565- url={`/guilds/${params.guildId}`}
6666- dataName="priorityRoleId"
6767- items={guild?.roles?.sort((a, b) => b.position - a.position).map((r) => ({ name: `@${r.name}`, value: r.id, color: r.color }))}
6868- description="People with this role bypass the queue and speak immediately."
6969- defaultState={guild?.tts.priorityRoleId}
7070- showClear
7171- />
7272- <Switch
7373- name="Announce user"
7474- badge="Experimental"
7575- url={`/guilds/${params.guildId}`}
7676- dataName="announceUser"
7777- description="If I should say who is currently speaking via tts."
7878- defaultState={guild?.tts.announceUser || false}
7979- />
8080- <NumberInput
8181- className="pt-7"
8282- name="Max message length"
8383- description="The maximum length of a message that can be spoken."
8484- url={`/guilds/${params.guildId}`}
8585- dataName="maxLength"
8686- defaultState={guild?.tts.maxLength || 4000}
8787- max={4000}
8888- />
8989- </div>
9090- }
9191- <Accordion
9292- className="lg:w-1/2"
9393- defaultExpandedKeys={["1"]}
9494- disableAnimation={cookies.get("reduceMotions") === "true"}
9595- >
9696- <AccordionItem
9797- key="1"
9898- aria-label="how this works"
9999- title="How this works"
100100- >
101101- 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.
3636+ <Section
3737+ title="Miscs"
3838+ >
3939+ Small tools that improve chatting to insanity.
4040+ </Section>
10241103103- <iframe
104104- className="mt-6 aspect-video rounded-lg"
105105- width={"100%"}
106106- src="https://www.youtube.com/embed/NS5fZ1ltovE?si=uODiGspuNGKPRQKp"
107107- title="Wamellow Text to Speech tutorial"
108108- allow="autoplay; clipboard-write; ENCRYPTION_TOKENed-media; picture-in-picture; web-share"
109109- />
110110- </AccordionItem>
111111- <AccordionItem
112112- key="2"
113113- aria-label="how to blacklist users"
114114- title="How to blacklist users"
115115- >
116116- <div>Blacklist a user using discord channel permissions</div>
117117- <br />
118118- <Link
119119- href="https://cdn.waya.one/r/YcU2CC.gif"
120120- target="_blank"
121121- >
122122- <Image
123123- alt="blacklist a user with discord channel permissions"
124124- className="rounded-md"
125125- height={945 / 2}
126126- src="https://cdn.waya.one/r/YcU2CC.gif"
127127- width={1040 / 2}
128128- />
129129- </Link>
130130- </AccordionItem>
131131- </Accordion>
132132- </div>
4242+ <Switch
4343+ name="Embed message links"
4444+ badge="Experimental"
4545+ url={`/guilds/${params.guildId}`}
4646+ dataName="tts.embedLinks"
4747+ description="Reply with the original content of a message if a message link is sent."
4848+ defaultState={guild?.embedLinks || false}
4949+ />
13350134134- </div>
135135- );
136136- <OverviewLink
5151+ </>);
13752}
+115
app/dashboard/[guildId]/tts.component.tsx
···11+import { guildStore } from "@/common/guilds";
22+import NumberInput from "@/components/inputs/number-input";
33+import SelectMenu from "@/components/inputs/select-menu";
44+import Switch from "@/components/inputs/switch";
55+import { Accordion, AccordionItem } from "@nextui-org/react";
66+import { useCookies } from "next-client-cookies";
77+import Image from "next/image";
88+import Link from "next/link";
99+import { useParams } from "next/navigation";
1010+1111+export function TTSSettings() {
1212+ const guild = guildStore((g) => g);
1313+ const params = useParams();
1414+1515+ return (
1616+ <div className="lg:flex gap-6 mt-5">
1717+ <div className="lg:w-1/2 space-y-6">
1818+ <SelectMenu
1919+ name="Chat to Speech channel"
2020+ url={`/guilds/${params.guildId}`}
2121+ dataName="tts.channelId"
2222+ 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(", ") }))}
2323+ description="Select a channel what channel should be used for tts."
2424+ defaultState={guild?.tts.channelId}
2525+ showClear
2626+ />
2727+ <SelectMenu
2828+ name="Usage logs"
2929+ url={`/guilds/${params.guildId}`}
3030+ dataName="tts.logChannelId"
3131+ items={guild?.channels?.sort((a, b) => a.name.localeCompare(b.name)).map((c) => ({ name: `#${c.name}`, value: c.id, error: c.missingPermissions.join(", ") }))}
3232+ description="Select a channel where usage logs should be posted into."
3333+ defaultState={guild?.tts.logChannelId}
3434+ showClear
3535+ />
3636+ <SelectMenu
3737+ name="Priority role"
3838+ url={`/guilds/${params.guildId}`}
3939+ dataName="tts.priorityRoleId"
4040+ items={guild?.roles?.sort((a, b) => b.position - a.position).map((r) => ({ name: `@${r.name}`, value: r.id, color: r.color }))}
4141+ description="People with this role bypass the queue and speak immediately."
4242+ defaultState={guild?.tts.priorityRoleId}
4343+ showClear
4444+ />
4545+ <Switch
4646+ name="Announce user"
4747+ badge="Experimental"
4848+ url={`/guilds/${params.guildId}`}
4949+ dataName="tts.announceUser"
5050+ description="If I should say who is currently speaking via tts."
5151+ defaultState={guild?.tts.announceUser || false}
5252+ />
5353+ <NumberInput
5454+ className="pt-7"
5555+ name="Max message length"
5656+ description="The maximum length of a message that can be spoken."
5757+ url={`/guilds/${params.guildId}`}
5858+ dataName="tts.maxLength"
5959+ defaultState={guild?.tts.maxLength || 4000}
6060+ max={4000}
6161+ />
6262+ </div>
6363+6464+ <Faq />
6565+ </div>
6666+ )
6767+}
6868+6969+function Faq() {
7070+ const cookies = useCookies();
7171+7272+ return (
7373+ <Accordion
7474+ className="lg:w-1/2"
7575+ defaultExpandedKeys={["1"]}
7676+ disableAnimation={cookies.get("reduceMotions") === "true"}
7777+ >
7878+ <AccordionItem
7979+ key="1"
8080+ aria-label="how this works"
8181+ title="How this works"
8282+ >
8383+ 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.
8484+8585+ <iframe
8686+ className="mt-6 aspect-video rounded-lg"
8787+ width="100%"
8888+ src="https://www.youtube.com/embed/NS5fZ1ltovE?si=uODiGspuNGKPRQKp"
8989+ title="Wamellow Text to Speech tutorial"
9090+ allow="autoplay; clipboard-write; ENCRYPTION_TOKENed-media; picture-in-picture; web-share"
9191+ />
9292+ </AccordionItem>
9393+ <AccordionItem
9494+ key="2"
9595+ aria-label="how to blacklist users"
9696+ title="How to blacklist users"
9797+ >
9898+ <div>Blacklist a user using discord channel permissions</div>
9999+ <br />
100100+ <Link
101101+ href="https://cdn.waya.one/r/YcU2CC.gif"
102102+ target="_blank"
103103+ >
104104+ <Image
105105+ alt="blacklist a user with discord channel permissions"
106106+ className="rounded-md"
107107+ height={945 / 2}
108108+ src="https://cdn.waya.one/r/YcU2CC.gif"
109109+ width={1040 / 2}
110110+ />
111111+ </Link>
112112+ </AccordionItem>
113113+ </Accordion>
114114+ )
115115+}
-1
app/dashboard/updates.component.tsx
···77import SelectMenu from "@/components/inputs/select-menu";
88import Modal from "@/components/modal";
991010-1110export default function FollowUpdates() {
1211 const guild = guildStore((g) => g);
1312