Open Geparder opened 1 year ago
Hello there! As you are a first time Issuer please check whether your issue description is reasonable and complete. If you are having an issue always include the versions you are using (NodeJs, Typescript, ...) as well as a way to reproduce it. Thank you for reading! Now continue :)
ping @bostrot
There is an issue with escaping, e.g. if you try to send this text with MarkdownV2
syntax it will fail:
Test (
'elem1' => 'test123',
'elem2' => 'test345',
'elem3' => 'test444',
)
This is because of the escape rules defined here for urls - https://github.com/bostrot/telegram-support-bot/blob/master/src/middleware.ts#L41
The error in the log will look like this:
GrammyError: Call to 'sendMessage' failed! (400: Bad Request: can't parse entities: Character '=' is reserved and must be escaped with the preceding '\')
Easiest fix is to comment this block of code, but then again for URL markdown won't work.
Also noticed that MarkdownV2
strips all tags like code tags ``` and send to the user as a plaintext message.
Maybe you could take a look at this issue @bostrot.
It seems forwarding messages with MarkDownV2 e.g. with code blocks or using some other elements will not work for your users, guess it's something that should be added as a feature.
Thanks.
"Thu May 25 2023 11:16:53 GMT+0000 (Coordinated Universal Time): GrammyError: Call to 'sendMessage' failed! (400: Bad Request: can't parse entities: Character '(' is reserved and must be escaped with the preceding '\')\n" + 2023-05-25T11:16:53.434547877Z ' at toGrammyError (/bot/node_modules/grammy/out/core/error.js:35:12)\n' + 2023-05-25T11:16:53.434553744Z ' at ApiClient.callApi (/bot/node_modules/grammy/out/core/client.js:86:48)'