windkh / node-red-contrib-telegrambot

Telegram bot nodes for node-red.
Other
267 stars 119 forks source link

Sending pdf file #394

Closed bombjackit closed 1 month ago

bombjackit commented 1 month ago

Goodmorning,

I take inspiration from the photo example to send a pdf from a file with a bot : there is a field of payload to valorise for change the name of pdf visualized in Telegram ? The name is always data.pdf, I can change payload.caption but this string appear down the thumb of pdf and does not affect the name of file.

windkh commented 1 month ago

@bombjackit you should use message type document instead of photo. You can use any property described here as "optional" in the msg.payload.options property https://core.telegram.org/bots/api#senddocument

see also https://github.com/windkh/node-red-contrib-telegrambot/blob/master/examples/senddocumenttochat.json

bombjackit commented 1 month ago

Thank you @windkh, obviously I set 'document' as type but the real solution was in the example that you mentioned : the key is fileOptions that did what I want.