tdlib / td

Cross-platform library for building Telegram clients
https://core.telegram.org/tdlib
Boost Software License 1.0
7.11k stars 1.44k forks source link

how to get entity for a markdown text #2757

Closed jnxyatmjx closed 9 months ago

jnxyatmjx commented 9 months ago

when i use sendMessage function. like that sendMessage chat_id:int53 message_thread_id:int53 reply_to:InputMessageReplyTo options:messageSendOptions reply_markup:ReplyMarkup input_message_content:InputMessageContent = Message;

I need put the parameter input_messagecontent, my question is how to get correct parameter for a markdown text. i use parseTextEntities but i get Entity begins in a middle of a UTF-16 symbol at byte offset 55_

jnxyatmjx commented 9 months ago

when i use sendMessage function. like that sendMessage chat_id:int53 message_thread_id:int53 reply_to:InputMessageReplyTo options:messageSendOptions reply_markup:ReplyMarkup input_message_content:InputMessageContent = Message;

I need put the parameter input_messagecontent, my question is how to get correct parameter for a markdown text. i use parseTextEntities but i get Entity begins in a middle of a UTF-16 symbol at byte offset 55_

text example šŸ‘ amazing videos \nšŸ‘‰ Y A Better You šŸ‘ˆ\nšŸ‘‰ Y Only Wait You šŸ‘ˆ

levlam commented 9 months ago

parseTextEntities can't return invalid entities. The method is designed to be used by bots. Regular users can use parseMarkdown, or specify entites manually.

jnxyatmjx commented 9 months ago

parseTextEntities can't return invalid entities. The method is designed to be used by bots. Regular users can use parseMarkdown, or specify entites manually.

is there any document for entities manually

levlam commented 9 months ago

Just specify them as part of formattedText.