-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Telegram desktop not displaying InlineQueryResultPhoto correctly #4580
Comments
@mbasaglia Can you provide a bot and his query for testing this? |
With {"results":[{"photo_url":"https:\/\/dragon.best\/api\/some_dragons.jpg?what=foo%20bar","type":"photo","thumb_url":"https:\/\/dragon.best\/api\/some_dragons.jpg?what=foo%20bar","id":"1030832774479917668-0"}],"inline_query_id":"1030832774479917668","is_personal":"false"} Note that after looking it on my phone it works on desktop too for that query (I assume because of caching) |
Now I've updated my bots to include the size to make them work on desktop, but I think this still needs to be fixed on the client side otherwise it isn't conforming to the bot API documentation. |
Note that even when the size is being sent, the telegram desktop client still acts weirdly: Then it shows correctly if you restart the client. |
And I've also noticed the inline previews often looks weird if the image background is transparent |
I think there has been a regression on this, now even with width/height set the result aren't fetched/displayed on telegram desktop (only cached results are shown, even if the bot disabled caching). |
@mbasaglia Please provide once again a bot and a query that do not work in tdesktop. Right now "@SomeDragonsBot foo bar" works fine for me. |
depends on caching, try a unique string as input, for example "@SomeDragonsBot hello123456" doesn't work for me |
I'd like to note I've also had this issue with my own bot. The bot is "@mtgtutorbot." Query works fine on mobile, but won't work on desktop (Win 10) if tried there first. I'm guessing it works on desktop after trying on mobile due to caching? Here are some queries I've tried:
The 2nd will work every time, but the first won't work until it's been attempted on mobile. |
This issue still persists, even if the bot responses have the correct size and no transparency, telegram desktop shows "no results" on inline bots returning images (but works for images already queried from a different client). |
An update, as I also ran into this lately:
Either way, this seems to be a bug in telegram desktop, not a bug in python-telegram-bot. |
I would just like to chime in. |
I have the same problem, can help to reproduce if needed (only in windows desktop client) |
I can confirm this as well: Once you type I debugged far enough to be able to confirm that all This is the LOC where the query result is sent |
I can also confirm this and it is very annoying. |
Hello. Developer, please pay attention to this thread, coz I wrote special bot for demonstrating a bug |
@AlexMercier Thanks! I’ll look into that. |
@AlexMercier Right now I can't show photo results with unknown image sizes :( I receive this:
And I look for image size attributes in those webDocument-s, I don't find them and I ignore those results :( |
is that size attribute the file size or the image dimensions? |
@mbasaglia The image dimension. It is marked as optional in API :( Please check if everything works fine with the valid dimensions passed to the bot api. I'll try to fix the case without dimensions, although it won't work very well in my case :( |
I checked. it work fine with heigth and width passed |
For me it doesn't work even if I'm sending the size |
@mbasaglia you pass |
This is the kind of response I give back:
but it doesn't work |
adding width and height to InlineQueryResultPhoto helps me. Now it works correctly. |
so, it's 3rd party bug and not telegram bug? |
@Lukasss93 But I'm afraid this is not related to the GET query in the URL, just about unknown image size. Do you provide (optional by docs) image size to the bot API? |
I can't do it. This is a non-production test bot. It runs on my computer right now.
OMG, it works by providing the image size! Anyway, this is still a problem because I want to use another image generator and I cannot predict the image size 😥 EDIT:
|
It's neat and all that people are finding possible causes and/or workarounds but the fact of the matter is that the same query result loads perfectly on any other client. |
I can confirm the bug (only on tdesktop), and can also confirm that setting both |
Nice find! I'd say that's definitely a bug though (as opposed to "not
supported by the API") as this is a valid URL, and the mobile app supports
this without any problem.
…On Sun 12 Jun 2022, 12:15 AM Luca Patera, ***@***.***> wrote:
Same issue here!
Found the reason: the telegram bot API doesn't support query strings.
Your image url MUST end with .jpg 😥
Example:
https://via.placeholder.com/300.jpg
[image: immagine]
<https://user-images.githubusercontent.com/4071613/173207862-c44a9718-ad09-4194-916b-532d423bcbef.png>
https://via.placeholder.com/300.jpg?text=hello
[image: immagine]
<https://user-images.githubusercontent.com/4071613/173207896-c06479d0-176e-4763-a523-05c2f8dd188e.png>
—
Reply to this email directly, view it on GitHub
<#4580 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXSJF7XKROBEL4E55SK233VOUM2VANCNFSM4EZQZNEA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
hello, it's clearly a bug. please fix. (not that i believe it will be done any time soon...) |
This fix is intended to mitigate a Telegram Desktop bug (telegramdesktop/tdesktop#4580) that prevents images from loading in inline query results. It also helps displaying thumbnails in the correct aspect ratio on Telegram apps on other platforms.
Hey there! This issue was inactive for a long time and will be automatically closed in 30 days if there isn't any further activity. We therefore assume that the user has lost interest or resolved the problem on their own. Don't worry though; if this is an error, let us know with a comment and we'll be happy to reopen the issue. Thanks! |
. |
This issue is still very much unresolved and very much an annoyance. |
5 years 🎉 |
u can just turn your pic into a .jpg and everything will work out fine. Good work around to try
…---- Replied Message ----
| From | ***@***.***> |
| Date | 07/15/2023 01:09 |
| To | ***@***.***> |
| Cc | ***@***.***>***@***.***> |
| Subject | Re: [telegramdesktop/tdesktop] Telegram desktop not displaying InlineQueryResultPhoto correctly (#4580) |
I had this bug last year and I'm still having it now.
I submit a phone url and a thumb url over the inline query, and did not supply any dimensions.
Without changing my code, I can type a query on tdesktop and have it return an error of no results
moving over to the official telegram app on ios, the message has been drafted from the desktop client and prepared on my phone, which automatically sends the query and delivers back the desired images
in addition to this, as the query has now been cached by telegram server, further use of the same query will function on tdesktop results in it behaving as intended
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
the problem rises when you have content from 3rd party which doesnt supply you the format AND/OR size |
I found what is likely the problem, tdesktop uses a MTPDwebDocument when fetching inline photos that haven't been cached, or at least that what I am remembering. I'm a few drinks in at this point but when writing this the real problem is what I'm looking at. additionally, when looking at the function that returns the image dimensions from the same file I don't think I can provide much more assistance on this, as any build of tdesktop takes around half an hour, so hopefully this might help in solving this issue, because without a greater understanding of the MTProto or how other clients are interacting with the data from the protocol, I would be hard pressed to solve this myself, and that's before the compile time issues if I did. Therefore I hope that this is some insightful information @john-preston |
Hey there! This issue was inactive for a long time and will be automatically closed in 30 days if there isn't any further activity. We therefore assume that the user has lost interest or resolved the problem on their own. Don't worry though; if this is an error, let us know with a comment and we'll be happy to reopen the issue. Thanks! |
ur mom is stale |
So if we want an issue to actually be fixed we need to have a bot comment on the ticket every 29 days? Cause that can be arranged... (This is such an awful way of artificially keeping bug numbers down.) |
it's not every 29 days instead 6 months, and the bot is needed because some times issues are fixed without remember to close linked issue. |
I feel like once an issue has had the stale tag removed, it shouldn't be marked over and over. All this does is spam everyone who is watching the issue and risks of an issue being closed without being solved... |
and if bug is fixed tomorrow and preston forgets this ticket? |
Is this reported on the telegram bug tracker also? Perhaps there would be better odds of this being fixed if reported over there |
literally the worst case scenario is: the opened issues will be 1 larger than they should for a while, until someone browsing for something to fix will find it, realize that it's been fixed already, and close it. |
OMG! Providing the images dimensions solved my blank boxes in the inline GIF query results! Thank you!! |
https://t.me/ltexbot suffers from this, too. It would be cool if TDesktop could handle missing dimensions correctly. |
@john-preston This issue was opened 6 years ago, I posted the above comment 2 years ago — the root cause was seemingly identified and yet as of today this is still relevant. Maybe not a priority, but bumping because at this point it almost seems like a forgotten issue. Thank you. |
Summary
I think recently there has been a regression that prevents photo results from inline bots from displaying correctly if photo_width and photo_height aren't provided (which are marked as optional in the API docs -- see https://core.telegram.org/bots/api#inlinequeryresultphoto).
This used to work fine, and it work fine on the Android client so I believe it's a bug with the desktop client, it appears it isn't even trying to send a request to photo_url when width/height aren't given.
Steps to reproduce
Expected behaviour
Client should GET the photo_url from the results and display them
Actual behaviour
Doesn't fetch not display the result
Configuration
Operating system: Ubuntu, bug happens on different versions
Version of Telegram Desktop: 1.2.17 I think the issue was there before the latest update, but was working a couple month ago
The text was updated successfully, but these errors were encountered: