Fix build errors

This commit is contained in:
Vignesh Natarajan
2026-01-27 23:08:43 -08:00
committed by Vignesh
parent 3a57106c1e
commit e12184661e
4 changed files with 68 additions and 32 deletions

View File

@@ -86,10 +86,14 @@ export async function resolveDiscordTarget(
const likelyUsername = isLikelyUsername(trimmed);
const shouldLookup = isExplicitUserLookup(trimmed, parseOptions) || likelyUsername;
// Parse directly if it's already a known format. Use a safe parse so ambiguous
// numeric targets don't throw when we still want to attempt username lookup.
const directParse = safeParseDiscordTarget(trimmed, parseOptions);
if (directParse && directParse.kind !== "channel" && !likelyUsername) {
return directParse;
}
if (!shouldLookup) {
return directParse ?? parseDiscordTarget(trimmed, parseOptions);
}