Discord: fix DM recipient parsing for bare numeric user IDs (#596)

Co-authored-by: Shadow <shadow@clawd.bot>
This commit is contained in:
Magi Metal
2026-01-09 13:58:25 -05:00
committed by GitHub
parent 04512ee67c
commit 50a5b4ddcc
8 changed files with 24 additions and 5 deletions

View File

@@ -305,6 +305,11 @@ function parseRecipient(raw: string): DiscordRecipient {
}
return { kind: "user", id: candidate };
}
if (/^\d+$/.test(trimmed)) {
throw new Error(
`Ambiguous Discord recipient "${trimmed}". Use "user:${trimmed}" for DMs or "channel:${trimmed}" for channel messages.`,
);
}
return { kind: "channel", id: trimmed };
}