windkh / node-red-contrib-telegrambot

Telegram bot nodes for node-red.
Other
265 stars 118 forks source link

InlineQueryResultVideo thumbnail #186

Closed moshed closed 3 years ago

moshed commented 3 years ago

I cant seem to get a specified thumbnail to show up correctly on InlineQueryResultVideo, but works perfectly fine on InlineQueryResultArticle

when using InlineQueryResultVideo

single_result = [{
    type: 'video',
    id: '1',
    video_url: 'https://video.twimg.com/amplify_video/1407558846822981632/vid/1280x720/rttlFu4iUy41szgF.mp4?tag=14',
    title: 'test',
    mime_type: 'video/mp4',
    thumb_url: 'https://img.mlbstatic.com/mlb-photos/image/upload/w_100/v1/people/660670/headshot/67/current.jpeg',
    parse_mode: 'Markdown',
    caption: 'test',
    description: 'date',
}]
msg.payload.results = single_result
return msg

I get the below without my specified thumbnail

image

but when using InlineQueryResultArticle with the below, the thumbnail shows up with no issues

single_result = [{
    type: 'article',
    id: 1,
    title: 'test',
    thumb_url: 'https://img.mlbstatic.com/mlb-photos/image/upload/w_100/v1/people/660670/headshot/67/current.jpeg',
    input_message_content: {
        message_text: 'https://video.twimg.com/amplify_video/1407558846822981632/vid/1280x720/rttlFu4iUy41szgF.mp4?tag=14',
    },
    description: 'date',
}]
msg.payload.results = single_result
return msg
image
windkh commented 3 years ago

So what are you sending exactly? answerInlineQuery, inline_query?

moshed commented 3 years ago

im using inline_query from this section of the readme

https://github.com/windkh/node-red-contrib-telegrambot#implementing-an-inline_query

image

the 2 function nodes are to easily toggle between the 2 examples I showed above.

windkh commented 3 years ago

Hm never tried that. Let me find out ….

moshed commented 3 years ago

thanks! am I not doing this the correct way? I never even noticed answerInlineQuery as I tried inline_query and it worked fine so I assumed I was doing it properly.

windkh commented 3 years ago

I cant seem to get a specified thumbnail to show up correctly on InlineQueryResultVideo, but works perfectly fine on InlineQueryResultArticle

when using InlineQueryResultVideo

single_result = [{
    type: 'video',
    id: '1',
    video_url: 'https://video.twimg.com/amplify_video/1407558846822981632/vid/1280x720/rttlFu4iUy41szgF.mp4?tag=14',
    title: 'test',
    mime_type: 'video/mp4',
    thumb_url: 'https://img.mlbstatic.com/mlb-photos/image/upload/w_100/v1/people/660670/headshot/67/current.jpeg',
    parse_mode: 'Markdown',
    caption: 'test',
    description: 'date',
}]
msg.payload.results = single_result
return msg

I get the below without my specified thumbnail

image

but when using InlineQueryResultArticle with the below, the thumbnail shows up with no issues

single_result = [{
    type: 'article',
    id: 1,
    title: 'test',
    thumb_url: 'https://img.mlbstatic.com/mlb-photos/image/upload/w_100/v1/people/660670/headshot/67/current.jpeg',
    input_message_content: {
        message_text: 'https://video.twimg.com/amplify_video/1407558846822981632/vid/1280x720/rttlFu4iUy41szgF.mp4?tag=14',
    },
    description: 'date',
}]
msg.payload.results = single_result
return msg
image

I took the video version of what you wrote and it generated the following output: image

--> I can see the thumb and I can click the link: the video is playing image

windkh commented 3 years ago

I took the standard desktop client for windows!

moshed commented 3 years ago

when I do the article version as you showed the thumbnail works fine. The issue arises when I try to send a video the thumbnail cant be specified. See below code:

single_result = [{
    type: 'video',
    id: '1',
    video_url: 'https://video.twimg.com/amplify_video/1407558846822981632/vid/1280x720/rttlFu4iUy41szgF.mp4?tag=14',
    title: 'video',
    mime_type: 'video/mp4',
    thumb_url: 'https://img.mlbstatic.com/mlb-photos/image/upload/w_100/v1/people/660670/headshot/67/current.jpeg',
    parse_mode: 'Markdown',
    caption: 'test',
    description: 'date',
},
{
    type: 'article',
    id: 2,
    title: 'article',
    thumb_url: 'https://img.mlbstatic.com/mlb-photos/image/upload/w_100/v1/people/660670/headshot/67/current.jpeg',
    input_message_content: {
        message_text: 'https://video.twimg.com/amplify_video/1407558846822981632/vid/1280x720/rttlFu4iUy41szgF.mp4?tag=14',
    },
    description: 'date',
}]
msg.payload.results = single_result
return msg

that results in below. the article thumbnail shows up fine but the thumbnail for the video does not.

image
moshed commented 3 years ago

@windkh sorry. dont know if you get notifications if the issue is closed so I wanted to tag you!

windkh commented 3 years ago

I will reopen it to give it a second try.

windkh commented 3 years ago

@moshed I can confirm that I have the same problem. I can not see anything wrong with your code. However I can not tell you why the thumbnail is not displayed. At least I guess it has nothing to do with the nodes.

moshed commented 3 years ago

ok! good to have some company! I will see if I can get an answer from telegrams end to see if an issue is with their API