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 twitch delete after stream

shi.gg 30ff8f8e bba80839

verified
+20 -3
+16 -3
app/dashboard/[guildId]/notifications/page.tsx
··· 9 9 import MessageCreatorEmbed from "@/components/embed-creator"; 10 10 import MultiSelectMenu from "@/components/inputs/multi-select-menu"; 11 11 import SelectMenu from "@/components/inputs/select-menu"; 12 + import Switch from "@/components/inputs/switch"; 12 13 import TextInput from "@/components/inputs/text-input"; 13 14 import { ScreenMessage } from "@/components/screen-message"; 14 15 import { AvatarBadge } from "@/components/ui/avatar"; 15 16 import { Button } from "@/components/ui/button"; 16 17 import { cacheOptions } from "@/lib/api"; 17 - import { type ApiV1GuildsModulesNotificationsGetResponse, BlueskyNotificationFlags, GuildFlags, NotificationType, YoutubeNotificationFlags } from "@/typings"; 18 - import { BitfieldManager, bitfieldToArray } from "@/utils/bitfields"; 18 + import { type ApiV1GuildsModulesNotificationsGetResponse, BlueskyNotificationFlags, GuildFlags, NotificationType, TwitchNotificationFlags, YoutubeNotificationFlags } from "@/typings"; 19 + import { BitfieldManager, bitfieldToArray, transformer } from "@/utils/bitfields"; 19 20 import { createSelectableItems } from "@/utils/create-selectable-items"; 20 21 import { getCanonicalUrl } from "@/utils/urls"; 21 22 import { LoaderCircleIcon } from "lucide-react"; ··· 234 235 } 235 236 </div> 236 237 238 + {item.type === NotificationType.Twitch && ( 239 + <Switch 240 + className="mt-2" 241 + label="Delete after stream ends" 242 + endpoint={url + "/" + item.id} 243 + k="flags" 244 + defaultState={(item.flags & TwitchNotificationFlags.DeleteAfterStream) !== 0} 245 + transform={(value) => value ? [TwitchNotificationFlags.DeleteAfterStream] : []} // very fucked up 246 + onSave={(value) => editItem("flags", transformer(value, item.flags, TwitchNotificationFlags.DeleteAfterStream))} 247 + /> 248 + )} 249 + 237 250 {platformFlags && ( 238 251 <TextInput 239 252 className="md:w-1/2 w-full" ··· 294 307 }} 295 308 size="lg" 296 309 variant="flat" 297 - disabled={isLoading } 310 + disabled={isLoading} 298 311 > 299 312 {isLoading 300 313 ? <LoaderCircleIcon className="animate-spin" />
+4
typings.ts
··· 421 421 MustContainImage = 1 << 3 422 422 } 423 423 424 + export enum TwitchNotificationFlags { 425 + DeleteAfterStream = 1 << 4 426 + } 427 + 424 428 export enum YoutubeNotificationFlags { 425 429 SendVideos = 1 << 5, 426 430 SendShorts = 1 << 6