I'm using node-telegram-bot-api package
and I have two telegram bots like this:
const TelegramBot = require('node-telegram-bot-api');
let bot1 = new TelegramBot(token1, { polling: true });
let bot2 = new TelegramBot(token2, { polling: true });
I'm kind of making a connection between these two bots, In a way that messages that are recieved from bot1 should be sent to user by bot2 and vice versa
something like:
bot1.on('message', (msg) => {
if (msg.video) { // video in this case
bot2.sendVideo(user2_chatid, msg.video.file_id);
}
});
In the above code I am trying to send the video to user2 using bot2, once bot1 receives a video
using file_id to reference sticker is all right, but for photos, videos, voices etc I get this error
wrong file identifier/HTTP URL specified
Looks like telegram is kind of private about the bots and the data they can share, means that file_id is something private and only accessible by the bot it self
How can I share these data between telegram bots?
and I strongly prefer a way other than saving photos and videos somewhere on the server then sending them