B4J 8.10
JDK 11.0.1
jTelegramBot 0.31
I have an error running example bot :
In /start command :
It seems to be due to the 'parsemode' in the 'sendmessage' command, if it is 'MARKDOWN' it goes into error, if it is 'HTML' no
This goes wrong:
This no error :
The same in all send messages.
Thanks for help
JDK 11.0.1
jTelegramBot 0.31
I have an error running example bot :
In /start command :
B4X:
MessageEntities: [MessageEntity{type=bot_command, offset=0, length=6, url='null', user=null}]
MessageText: /start
main._appstart (java line: 57)
java.lang.RuntimeException: NegativeResponseException{httpResponseCode=400, errorCode=400, description='Bad Request: can't parse entities: Can't find end of the entity starting at byte offset 12'} io.fouad.jtb.core.exceptions.NegativeResponseException: Error Code = 400 | Description = Bad Request: can't parse entities: Can't find end of the entity starting at byte offset 12
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:120)
at anywheresoftware.b4a.BA$3.run(BA.java:247)
at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:30)
at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:26)
at anywheresoftware.b4a.keywords.Common.StartMessageLoop(Common.java:153)
at b4j.example.main._appstart(main.java:57)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:78)
at b4j.example.main.main(main.java:28)
Caused by: NegativeResponseException{httpResponseCode=400, errorCode=400, description='Bad Request: can't parse entities: Can't find end of the entity starting at byte offset 12'} io.fouad.jtb.core.exceptions.NegativeResponseException: Error Code = 400 | Description = Bad Request: can't parse entities: Can't find end of the entity starting at byte offset 12
at io.fouad.jtb.core.utils.HttpClient.readResponse(HttpClient.java:360)
at io.fouad.jtb.core.utils.HttpClient.sendHttpPost(HttpClient.java:318)
at io.fouad.jtb.core.JTelegramBot.sendMessage(JTelegramBot.java:328)
at de.donmanfred.JTBwrapper.sendMessage(JTBwrapper.java:295)
at b4j.example.main._jtb_onmessagereceived(main.java:293)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91)
... 12 more
It seems to be due to the 'parsemode' in the 'sendmessage' command, if it is 'MARKDOWN' it goes into error, if it is 'HTML' no
This goes wrong:
B4X:
else If message.Text = "/start" Then
jtb.sendMessage(jtb.byId(from.Id),$" Hello ${chat.Username}
`Command | Result
----------|-------------------------
/location | Returns a Locationobject
/document | Returns a Document
/photo | Returns a Photo
/audio | Returns a Audiofile
/url | Returns a URL with Preview
/plainurl | Returns a URL without Preview
/buttons | Shows some buttons To Click on
`
Thank you For choosing Me :-)"$,"MARKDOWN",False,False,message.MessageId,Null)
This no error :
B4X:
else If message.Text = "/start" Then
jtb.sendMessage(jtb.byId(from.Id),$" Hello ${chat.Username}
`Command | Result
----------|-------------------------
/location | Returns a Locationobject
/document | Returns a Document
/photo | Returns a Photo
/audio | Returns a Audiofile
/url | Returns a URL with Preview
/plainurl | Returns a URL without Preview
/buttons | Shows some buttons To Click on
`
Thank you For choosing Me :-)"$,"HTML",False,False,message.MessageId,Null) ' <---- Change in HTML
The same in all send messages.
Thanks for help