The weeb for the next gen discord boat - Wamellow wamellow.com
bot discord
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

add keyword filter automod

shi.gg 6a287608 1b900188

verified
+52 -5
+19
app/dashboard/[guildId]/moderation/page.tsx
··· 6 6 import { guildStore } from "@/common/guilds"; 7 7 import MultiSelectMenu from "@/components/inputs/multi-select-menu"; 8 8 import Switch from "@/components/inputs/switch"; 9 + import TextInput from "@/components/inputs/text-input"; 9 10 import Notice from "@/components/notice"; 10 11 import { useApi } from "@/lib/api/hook"; 11 12 import { type ApiV1GuildsModulesAutomodGetResponse, AutomodType } from "@/typings"; ··· 59 60 defaultState={data.whitelistChannelIds} 60 61 max={50} 61 62 disabled={!enabled} 63 + onSave={(value) => { 64 + edit("whitelistChannelIds", value.map((entry) => entry.value as string)); 65 + }} 62 66 /> 63 67 </div> 64 68 <div className="lg:w-1/2"> ··· 71 75 defaultState={data.whitelistRoleIds} 72 76 max={20} 73 77 disabled={!enabled} 78 + onSave={(value) => { 79 + edit("whitelistRoleIds", value.map((entry) => entry.value as string)); 80 + }} 74 81 /> 75 82 </div> 76 83 </div> 84 + 85 + <TextInput 86 + name="Keyword filter" 87 + url={url} 88 + dataName="keywordFilter" 89 + description="Separate words or phrases with a comma (dog, cat, tiger) or new line. For each word, use * at the beginning, end, or both for partial matching." 90 + defaultState={data.keywordFilter.join(", ")} 91 + max={Infinity} 92 + onSave={(value) => { 93 + edit("keywordFilter", (value as string | null)?.split(",").map((word) => word.trim()) || []); 94 + }} 95 + /> 77 96 </>); 78 97 }
+32 -5
components/tts-faq.tsx
··· 1 1 import { Accordion, AccordionItem } from "@nextui-org/react"; 2 2 import Link from "next/link"; 3 + import { useParams } from "next/navigation"; 3 4 import { useCookies } from "next-client-cookies"; 4 - import { HiExternalLink } from "react-icons/hi"; 5 + import { HiExternalLink, HiOutlineHand } from "react-icons/hi"; 5 6 6 7 import { Button } from "./ui/button"; 7 8 8 9 export function TTSFaq() { 9 10 const cookies = useCookies(); 11 + const params = useParams(); 10 12 11 13 return ( 12 14 <Accordion ··· 29 31 allow="autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share" 30 32 /> 31 33 32 - <DocumentationLink /> 34 + <Buttons guildId={params.guildId as string} /> 33 35 </AccordionItem> 34 36 <AccordionItem 35 37 key="2" ··· 46 48 allow="autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share" 47 49 /> 48 50 49 - <DocumentationLink /> 51 + <Buttons guildId={params.guildId as string} /> 50 52 </AccordionItem> 51 53 </Accordion> 52 54 ); 53 55 } 54 56 57 + function Buttons({ guildId }: { guildId: string; }) { 58 + return ( 59 + <div className="flex gap-1.5 my-2"> 60 + <DocumentationLink /> 61 + <BlockWordsAndSlursButton guildId={guildId} /> 62 + </div> 63 + ); 64 + } 65 + 55 66 function DocumentationLink() { 56 67 return ( 57 68 <Button 58 69 asChild 59 - className="my-2" 60 70 size="sm" 61 71 > 62 72 <Link 63 - className="flex items-center" 64 73 href="/docs/text-to-speech" 65 74 target="_blank" 66 75 > 67 76 Read the documentation 68 77 <HiExternalLink /> 78 + </Link> 79 + </Button> 80 + ); 81 + } 82 + 83 + function BlockWordsAndSlursButton({ guildId }: { guildId: string; }) { 84 + return ( 85 + <Button 86 + asChild 87 + size="sm" 88 + > 89 + {/* it causes weird state issues with the pill bar without target="_top */} 90 + <Link 91 + href={`/dashboard/${guildId}/moderation`} 92 + target="_top" 93 + > 94 + <HiOutlineHand className="size-4" /> 95 + Block words and slurs 69 96 </Link> 70 97 </Button> 71 98 );
+1
typings.ts
··· 369 369 status: Record<AutomodType, boolean>; 370 370 whitelistChannelIds: string[]; 371 371 whitelistRoleIds: string[]; 372 + keywordFilter: string[]; 372 373 } 373 374 374 375 export interface Upload {