I'm writing a telegram bot with telegraf. I want to send a photo with a text under it in the reply message. I have written this:
serviceDetailsScene.on('callback_query', async ({replyWithPhoto}) => {
await replyWithPhoto({url: <url>})
}
It works and sends image properly, but I don't know how to append the message to it.
Thanks for any help.
You can do this for replying with image src and caption:
bot.hears('photo', ctx.replyWithPhoto({ source: <pic-src> }, { caption: "cat photo" });
And if you want to send image url you can write this:
bot.hears('photo', ctx.replyWithPhoto({ url: <pic-url> }, { caption: "cat photo" });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With