mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 01:51:24 +00:00
Discord: fix DM recipient parsing for bare numeric user IDs (#596)
Co-authored-by: Shadow <shadow@clawd.bot>
This commit is contained in:
@@ -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 };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user