How can I post long text and attach image? #1602
Replies: 2 comments 4 replies
-
"Attach an image at the bottom" is not a feature of Telegram. You'll need to send them as two separate messages. ctx.telegram.sendMessage(userId, text);
ctx.telegram.sendPhoto(userId, { source: fs.readFileSync('./img.png') }); |
Beta Was this translation helpful? Give feedback.
-
As @MKRhere answered, the image cannot be at the bottom, but If you're OK with the image at the top, then it is feasible to send long text and attach an image at the same time with a single command. I used to be able to do that with another even simpler telegram client. The trick is to put your long text as the caption, and the added bonus is that Markdown is supported in the caption. (I'm still trying to find out how to do that with telegraf...) |
Beta Was this translation helpful? Give feedback.
-
How can I place long text and attach an image at the bottom?
Faced such a problem. I can't find a solution. Maybe I'm using the wrong function?
const imageFile = fs.readFileSync('./img.png'); ctx.telegram.sendMessage( userId, 'text' + imageFile, )
Beta Was this translation helpful? Give feedback.
All reactions