Skip to content

Commit 0c420fb

Browse files
author
aadamgough
committed
fixed telegram
1 parent f19c5b4 commit 0c420fb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

apps/sim/tools/telegram/send_document.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,15 @@ export const telegramSendDocumentTool: ToolConfig<
4848
'Content-Type': 'application/json',
4949
}),
5050
body: (params: TelegramSendDocumentParams) => {
51+
let normalizedFiles: unknown[] | null = null
52+
if (params.files) {
53+
normalizedFiles = Array.isArray(params.files) ? params.files : [params.files]
54+
}
55+
5156
return {
5257
botToken: params.botToken,
5358
chatId: params.chatId,
54-
files: params.files || null,
59+
files: normalizedFiles,
5560
caption: params.caption,
5661
}
5762
},

0 commit comments

Comments
 (0)