Node.js Telegram Bot API send an image with text
To send an image with text using the Telegram Bot API in Node.js, you can use the node-fetch library to make HTTP requests and the FormData module to handle multipart/form-data requests for uploading images. First, install the required modules: npm install node-fetch Here's an example code snippet to send an image with text using the Telegram Bot API: const fetch = require('node-fetch'); const FormData = require('form-data'); const BOT_TOKEN = 'YOUR_TELEGRAM_BOT_TOKEN'; const CHAT_ID = 'TARGET_CHAT_ID'; async function sendImageWithText() { const photoUrl = 'URL_TO_YOUR_IMAGE'; // Replace with the URL of your image const form = new FormData(); form.append('chat_id', CHAT_ID); form.append('photo', photoUrl); form.append('caption', 'Your text caption goes here'); try { const response = await fetch(`https://api.telegram.org/bot${BOT_TOKEN}/sendPhoto`, { method: 'POST', ...