1

I've got some problem with adding local voice file to results array in answerInlineQuery method of inline_query mode.

import TelegramBot from 'node-telegram-bot-api'
const bot = new TelegramBot('my bot token', { polling: true })

bot.on('inline_query', query => {
    console.log(query)

    const results = []
    results.push({ id: 4, type: 'article', title: 'article 1', input_message_content: { message_text: 'article 1' } })
    results.push({ id: 5, type: 'voice', title: 'voice 1', voice_url: 'voices/1.ogg' })
    bot.answerInlineQuery(query.id, results, { cache_time: 10 })
})

bot.answerInlineQuery(query.id, results, { cache_time: 10 })

I know, that voice_url is useless for file path, but i don't see any other opportunity to add it.

I'd like to know if it is possible at all in inline mode, because non-inline method SendVoice supports this function.

Nicola
  • 11
  • 2
  • [Please do not upload images of code/errors when asking a question.](//meta.stackoverflow.com/q/285551) – 0stone0 Jul 02 '21 at 15:48
  • Maybe an [`InlineQueryResultVoice`](https://core.telegram.org/bots/api#inlinequeryresultvoice) could help. Unfortunaly, if [I search for it](https://github.com/yagop/node-telegram-bot-api/search?q=InlineQueryResultVoice) in the [node-telegram-bot-api](https://github.com/yagop/node-telegram-bot-api), nothing is found. Maybe they havent updated it yet. (`InlineQueryResultVoice` was released on [November 4 2020](https://core.telegram.org/bots/api#november-4-2020)). – 0stone0 Jul 02 '21 at 16:21
  • So it means I can't realize inline voice messages function with this library? – Nicola Jul 02 '21 at 16:41

0 Answers0