Error when mentioning some groups. #25

Closed
opened 2025-04-17 22:11:37 +03:00 by skobkin · 1 comment
Owner
telegram-mention-bot  | time=2025-04-17T19:11:26.714Z level=ERROR msg="bot: Failed to send message" error="telego: sendMessage: api: 400 \"Bad Request: can't parse entities: Can't find end of Italic entity at byte offset 16\"" chat_id=-<redacted> text_length=39
``` telegram-mention-bot | time=2025-04-17T19:11:26.714Z level=ERROR msg="bot: Failed to send message" error="telego: sendMessage: api: 400 \"Bad Request: can't parse entities: Can't find end of Italic entity at byte offset 16\"" chat_id=-<redacted> text_length=39 ```
skobkin self-assigned this 2025-04-17 22:11:37 +03:00
Author
Owner

It's caused by _ symbol in someone's username.

mentions = append(mentions, fmt.Sprintf("@%s", member.User.Username))

Need to check if it's OK to escape the username inside the mention.

It's caused by `_` symbol in someone's username. ```go mentions = append(mentions, fmt.Sprintf("@%s", member.User.Username)) ``` Need to check if it's OK to escape the username inside the mention.
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-group-mention-bot#25
No description provided.