B4J Question Error sending an image with JTelegrambot

Yoldi

Member
Regards.
When sending with a telegram bot (with the jTelegrambot version 0.24 library) an image

with this instruction:

jtb.sendPhoto (jtb.byId (from.Id), jtb.MediaByFile (File.DirApp, "Cafeteria.jpg"), "Caption Document", False, Null, replbld.hideCustomKeyboard)

send it and give this error

java.lang.RuntimeException: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "file_unique_id" (class io.fouad.jtb.core.beans.PhotoSize), not marked as ignorable (5 known properties: "file_path" , "file_size", "file_id", "height", "width"])

The same happens if I send a document.

How can it be corrected?

Thank you








B4X:
B4X:
 

DonManfred

Expert
Licensed User
Longtime User
Please use [CODE]code here...[/CODE] tags when posting code.

There is also NO need to change the font to bold. Use Quote tag when posting logs.
 
Last edited:
Upvote 0

behnam_tr

Active Member
Licensed User
Longtime User
use this code
i use this code and is ok for sending a photo to user in telegrambot (jtelegrambot v0.24)
B4X:
jtb2.sendPhoto(jtb2.byId(uid),jtb2.MediaByFile(File.DirApp&"/user_reports",filename),"your caption",True,Null,mark)
 
Upvote 0
Top