fix(discord): normalize bare numeric IDs in outbound target resolution
Bare numeric Discord IDs (e.g. '1470130713209602050') in cron delivery.to caused 'Ambiguous Discord recipient' errors and silent delivery failures. Adds normalizeDiscordOutboundTarget() to the existing Discord normalize module (channels/plugins/normalize/discord.ts) alongside normalizeDiscordMessagingTarget. Defaults bare numeric IDs to 'channel:<id>', matching existing behavior. Both the Discord extension plugin and standalone outbound adapter use the shared helper via a one-liner resolveTarget. Fixes #14753. Related: #13927
This commit is contained in:
@@ -16,6 +16,7 @@ import {
|
||||
migrateBaseNameToDefaultAccount,
|
||||
normalizeAccountId,
|
||||
normalizeDiscordMessagingTarget,
|
||||
normalizeDiscordOutboundTarget,
|
||||
PAIRING_APPROVED_MESSAGE,
|
||||
resolveDiscordAccount,
|
||||
resolveDefaultDiscordAccountId,
|
||||
@@ -291,6 +292,7 @@ export const discordPlugin: ChannelPlugin<ResolvedDiscordAccount> = {
|
||||
chunker: null,
|
||||
textChunkLimit: 2000,
|
||||
pollMaxOptions: 10,
|
||||
resolveTarget: ({ to }) => normalizeDiscordOutboundTarget(to),
|
||||
sendText: async ({ to, text, accountId, deps, replyToId, silent }) => {
|
||||
const send = deps?.sendDiscord ?? getDiscordRuntime().channel.discord.sendMessageDiscord;
|
||||
const result = await send(to, text, {
|
||||
|
||||
Reference in New Issue
Block a user