diff --git a/src/channels/line/adapter.ts b/src/channels/line/adapter.ts index e0baed2..1cd1898 100644 --- a/src/channels/line/adapter.ts +++ b/src/channels/line/adapter.ts @@ -169,6 +169,19 @@ export class LineAdapter implements ChannelAdapter { } finally { await rm(tempDir, { recursive: true, force: true }); } + + if (message.attachments && message.attachments.length > 0) { + for (const attachment of message.attachments) { + if (attachment.url) { + const line = attachment.filename ? `${attachment.filename}: ${attachment.url}` : attachment.url; + await this.sendPush(peerId, line); + continue; + } + if (attachment.data) { + console.warn(`LINE: skipping attachment data (${attachment.mimeType}) — upload not implemented`); + } + } + } } async handleRequest(req: IncomingMessage, res: ServerResponse): Promise { diff --git a/src/channels/zalo/adapter.ts b/src/channels/zalo/adapter.ts index 080be27..754781d 100644 --- a/src/channels/zalo/adapter.ts +++ b/src/channels/zalo/adapter.ts @@ -159,6 +159,19 @@ export class ZaloAdapter implements ChannelAdapter { } finally { await rm(tempDir, { recursive: true, force: true }); } + + if (message.attachments && message.attachments.length > 0) { + for (const attachment of message.attachments) { + if (attachment.url) { + const line = attachment.filename ? `${attachment.filename}: ${attachment.url}` : attachment.url; + await this.sendText(peerId, line); + continue; + } + if (attachment.data) { + console.warn(`Zalo: skipping attachment data (${attachment.mimeType}) — upload not implemented`); + } + } + } } async handleRequest(req: IncomingMessage, res: ServerResponse): Promise {