4

Is there any way to send a voice command to Telegram bot?

I want to send voices to my bot and use google API to convert them to text and then translate and send back.

In order to do this, I need to get the voice first. Is there any way to send the voice to the bot?

CallMeStag
  • 5,467
  • 1
  • 7
  • 22
Arman Fatahi
  • 2,635
  • 3
  • 24
  • 37

2 Answers2

3

You can find file_id from Voice update, and then obtain download path via the getFile method.

This object represents a file ready to be downloaded.
The file can be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>.

In above instance, you can download from https://api.telegram.org/file/bot485609210:mySecret/voice/file_178.

Sean Wei
  • 7,433
  • 1
  • 19
  • 39
  • Thanks, following your response I could find the part of documentation which explained more about this: https://core.telegram.org/bots/api#getfile However, I am still trying to download something. – Arman Fatahi Jan 22 '18 at 11:27
0

You can send a voice message to the bot, which would be stored on your server. Than convert it to text using Google API, translate and send back. Do you want to send it back as text?