Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Sending a voice message from an OGG file using the InsanusMokrassar/TelegramBotAPI

I am using the InsanusMokrassar/TelegramBotAPI (AKA @ktgbotapi) to make a simple bot that sends random messages to a group of friends. I was wondering, how can I send a voice message starting from an .ogg file I already have that sound inside my package. Now I am trying to use bot.sendVoice() but it asks for a VoiceFile that I don’t know how to create.

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

you may use sendVoice with InputFile created from MPPFile (common File on JVM) with asMultipartFile extension

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading