feat(commands): unify chat commands (#275)

* Chat commands: registry, access groups, Carbon

* Chat commands: clear native commands on disable

* fix(commands): align command surface typing

* docs(changelog): note commands registry (PR #275)

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
This commit is contained in:
Shadow
2026-01-06 14:17:56 -06:00
committed by GitHub
parent 1bf44bf30c
commit 9b22e1f6e9
40 changed files with 2357 additions and 1459 deletions

View File

@@ -74,3 +74,27 @@ export async function probeDiscord(
};
}
}
export async function fetchDiscordApplicationId(
token: string,
timeoutMs: number,
fetcher: typeof fetch = fetch,
): Promise<string | undefined> {
const normalized = normalizeDiscordToken(token);
if (!normalized) return undefined;
try {
const res = await fetchWithTimeout(
`${DISCORD_API_BASE}/oauth2/applications/@me`,
timeoutMs,
fetcher,
{
Authorization: `Bot ${normalized}`,
},
);
if (!res.ok) return undefined;
const json = (await res.json()) as { id?: string };
return json.id ?? undefined;
} catch {
return undefined;
}
}