yagop / node-telegram-bot-api

Telegram Bot API for NodeJS
MIT License
8.13k stars 1.49k forks source link

issue with inline photos #1151

Open crycime opened 7 months ago

crycime commented 7 months ago

There is an issue with inline photos, as I'm unable to display the title and description in answerInline. Below is a code demo:"

import TelegramBot from 'node-telegram-bot-api'
;(async () => {
  const bot = new TelegramBot('', {
    polling: true
  })
  bot.onText(/\/share/, msg => {
    const chatId = msg.chat.id
    bot.sendMessage(chatId, 'Click on the button below:', {
      reply_markup: {
        inline_keyboard: [[{ text: 'share', switch_inline_query: '' }]]
      }
    })
  })

  bot.on('inline_query', query => {
    const inlineQueryId = query.id
    bot.answerInlineQuery(inlineQueryId, [
      {
        type: 'photo',
        id: '81',
        photo_width: 48,
        photo_height: 48,
        photo_url:
          'https://ipfs.io/ipfs/bafybeie724zvyylvhup2dt6qi2koccocopxtidxsclo67neewluiyuupsu/6625eddb-956e-4879-b053-d627c41eb446.jpg',
        thumb_url:
          'https://ipfs.io/ipfs/bafybeie724zvyylvhup2dt6qi2koccocopxtidxsclo67neewluiyuupsu/6625eddb-956e-4879-b053-d627c41eb446.jpg',
        title: 'title',
        description: 'description',
        caption: '👏👏👏 Welcome'
      }
    ])
  })
})()

WechatIMG579