2026-08-01 09:19:39 +07:00
|
|
|
import useSWR from "swr";
|
2026-07-26 16:14:32 +07:00
|
|
|
|
|
|
|
|
import { voiceApi } from "@/lib/api";
|
|
|
|
|
import type { Guild } from "@/lib/types";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Fetch the list of available Discord guilds.
|
|
|
|
|
*/
|
2026-07-26 16:55:20 +07:00
|
|
|
export function useGuilds() {
|
2026-08-01 09:19:39 +07:00
|
|
|
return useSWR<Guild[]>(["guilds"], () => voiceApi.getGuilds(), {
|
|
|
|
|
dedupingInterval: 60_000,
|
2026-07-26 16:55:20 +07:00
|
|
|
});
|
2026-07-26 16:14:32 +07:00
|
|
|
}
|