mirror of
https://github.com/sern-handler/website
synced 2026-06-28 02:32:23 +00:00
22 lines
508 B
Plaintext
22 lines
508 B
Plaintext
---
|
|
import { z } from "astro/zod";
|
|
import BotCarousel from "~/components/BotCarousel";
|
|
import { BotSchema } from "~/utils/types";
|
|
import { zodFetch } from "~/utils/fetch";
|
|
import { shuffle } from "~/utils/shuffle";
|
|
|
|
const botResponse = await zodFetch(
|
|
z.array(BotSchema),
|
|
"Failed to fetch community bot data",
|
|
"https://frontpage.sern.dev/getBots",
|
|
);
|
|
|
|
if (!botResponse.ok) {
|
|
return console.error(botResponse.error);
|
|
}
|
|
---
|
|
|
|
<div>
|
|
<BotCarousel bots={shuffle(botResponse.value)} client:load />
|
|
</div>
|