mirror of
https://github.com/ZHANGTIANYAO1/teamspeak-music-bot.git
synced 2026-10-02 04:52:50 +08:00
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
11 lines
431 B
TypeScript
11 lines
431 B
TypeScript
/** Given the desired scoped id (from ?bot) and the known bot ids, decide the
|
|
* effective scope. Returns the id if it exists, else null (graceful clear:
|
|
* a stale/forbidden id never locks the UI). */
|
|
export function resolveScopedBot(
|
|
requestedId: string | null | undefined,
|
|
knownBotIds: readonly string[],
|
|
): string | null {
|
|
if (!requestedId) return null;
|
|
return knownBotIds.includes(requestedId) ? requestedId : null;
|
|
}
|