Error while trying to cheer @<user> up #18

Closed
opened 2024-03-12 19:32:49 +00:00 by skobkin · 1 comment
Owner
2024/03/12 22:23:10 INFO /hey message-text="/hey@<redacted> Can you at least wish @<user> a happy day at work?"
<...>
2024/03/12 22:23:11 DEBUG llm: Received LLM back-end response response="{ID:chatcmpl-475 Object:chat.completion Created:1710271391 Model:dolphin-mistral:7b-v2.6-q4_K_M Choices:[{Index:0 Message:{Role:assistant Content: Certainly, @<user>! I hope you have a fantastic and productive day at work filled with positive energy and success. Cheers! 🌟🤗✨ MultiContent:[] Name: FunctionCall:<nil> ToolCalls:[] ToolCallID:} FinishReason:stop LogProbs:<nil>}] Usage:{PromptTokens:24 CompletionTokens:43 TotalTokens:67} SystemFingerprint:fp_ollama httpHeader:map[Content-Length:[444] Content-Type:[application/json] Date:[Tue, 12 Mar 2024 19:23:11 GMT]]}"
<...>
2024/03/12 22:23:11 DEBUG telego: API call to: %q, with data: %s[https://api.telegram.org/<redacted>/sendMessage {"chat_id":<redacted>,"text":" Certainly, @user! I hope you have a fantastic and productive day at work filled with positive energy and success. Cheers! 🌟🤗✨","parse_mode":"Markdown","reply_parameters":{"message_id":1128,"chat_id":""}}]
2024/03/12 22:23:11 DEBUG telego: API response %s: %s[sendMessage Ok: false, Err: [400 "Bad Request: can't parse entities: Can't find end of the entity starting at byte offset 20"]]
``` 2024/03/12 22:23:10 INFO /hey message-text="/hey@<redacted> Can you at least wish @<user> a happy day at work?" <...> 2024/03/12 22:23:11 DEBUG llm: Received LLM back-end response response="{ID:chatcmpl-475 Object:chat.completion Created:1710271391 Model:dolphin-mistral:7b-v2.6-q4_K_M Choices:[{Index:0 Message:{Role:assistant Content: Certainly, @<user>! I hope you have a fantastic and productive day at work filled with positive energy and success. Cheers! 🌟🤗✨ MultiContent:[] Name: FunctionCall:<nil> ToolCalls:[] ToolCallID:} FinishReason:stop LogProbs:<nil>}] Usage:{PromptTokens:24 CompletionTokens:43 TotalTokens:67} SystemFingerprint:fp_ollama httpHeader:map[Content-Length:[444] Content-Type:[application/json] Date:[Tue, 12 Mar 2024 19:23:11 GMT]]}" <...> 2024/03/12 22:23:11 DEBUG telego: API call to: %q, with data: %s[https://api.telegram.org/<redacted>/sendMessage {"chat_id":<redacted>,"text":" Certainly, @user! I hope you have a fantastic and productive day at work filled with positive energy and success. Cheers! 🌟🤗✨","parse_mode":"Markdown","reply_parameters":{"message_id":1128,"chat_id":""}}] 2024/03/12 22:23:11 DEBUG telego: API response %s: %s[sendMessage Ok: false, Err: [400 "Bad Request: can't parse entities: Can't find end of the entity starting at byte offset 20"]] ```
skobkin added the
bug
label 2024-03-12 19:32:49 +00:00
skobkin self-assigned this 2024-03-12 19:32:49 +00:00
Author
Owner

Looks like it's a _ in username which causes the parsing problem on Telegram's bot API side.

To escape characters '_', '*', '`', '[' outside of an entity, prepend the characters '' before them.

via markdown style

Looks like it's a `_` in username which causes the parsing problem on Telegram's bot API side. > To escape characters '_', '*', '`', '[' outside of an entity, prepend the characters '\' before them. via [markdown style](https://core.telegram.org/bots/api#markdown-style)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: skobkin/telegram-ollama-reply-bot#18
No description provided.