The weeb for the next gen discord boat - Wamellow
wamellow.com
bot
discord
1import { type RESTError, type RESTGetAPIGuildWidgetJSONResult, Routes } from "discord-api-types/v10";
2
3import { rest } from ".";
4
5export async function fetchWidget(guildId: string) {
6 const widget = await rest.get(Routes.guildWidgetJSON(guildId)) as RESTGetAPIGuildWidgetJSONResult | RESTError;
7 if (!widget || "message" in widget) return null;
8
9 return widget;
10}