Closed Helias closed 1 year ago
There is a small issue in this idea: it would make sense to send a photo per professor (if available). But while right now all the search result are condensed in one message (or more, if it gets too long), sending one photo per professor could cause a FloodMessageError, and you can't really insert the photo in a text message
we could send the photo and in a second message the text
The issue still stands. The problem is that a user could request all the professors. This means that the bot would need to send n photo/messages, and both would count toward the flood limit. You could send all the photos together with all the text, but it would defeat the purpose
oh right, we could send the photo only if the result is one
We could edit the database's structure to help us retriving the correct image. If we are able to perform http requests we can just add a column like "photo_id" and puts the related ids (example: Barbanera => 2 => http://web.dmi.unict.it/foto_docenti/2.jpg). Otherwise we can just compress and save base64 images inside the database as a "photo" column.
Regarding the FloodError I think we can only implement something like @Helias suggested, providing photo only if the query returns one row.
send photo of the professor next to the info the photo is available in the website, exapmle: http://web.dmi.unict.it/docenti/gallo.giovanni