I use the library meteor-telegram-bot . Now I get from the bot only the text like this:

TelegramBot.setCatchAllText(true, function(username, message) { TelegramBot.send("Markdown-flavored Message:\n" + message.text, message.chat.id, true); }); 

I found the code, but it takes the document, and I need it to take a photo and plus the text that the user will write.

File Acceptance Code:

 TelegramBot.addListener('incoming_document', function(c, u, o) { TelegramBot.send('Got a file with ID ' + o.document.file_id, o.chat.id); var file = TelegramBot.method('getFile', { file_id: o.document.file_id }).result.file_path; TelegramBot.send('Download the file at https://api.telegram.org/file/bot' + TelegramBot.token + '/' + file, o.chat.id); }, 'document'); 

And I need exactly the photo.

  • Where are you having trouble? Add a code to the question. - 0xdb
  • Now I get only text from a bot, like this: TelegramBot.setCatchAllText (true, function (username, message) {TelegramBot.send ("Markdown-flavored Message: \ n" + message.text, message.chat.id, true);}); - ilyad3
  • How to make it so that you receive not only text, but also a picture along with this text? - ilyad3
  • I found the code here, but it accepts the document, and I need it to receive a photo from it and plus the text that the user will write. Here's the code: TelegramBot.addListener ('incoming_document', function (c, u, o) {TelegramBot.send ('Got a file with ID' + o.document.file_id, o.chat.id); var file = TelegramBot. method ('getFile', {file_id: o.document.file_id}). result.file_path; // TelegramBot.send ('Download the file at api. telegram.org/file/bot '+ TelegramBot.token +' / '+ file, o.chat.id);},' document '); - ilyad3
  • Move the code into the question body with the edit button. - 0xdb

0