Closed meth0xy closed 2 years ago
Okay i found out that i have to use the MessageEnitys and specify each word with an entity.
Okay i found out that i have to use the MessageEnitys and specify each word with an entity.
Could you share an example of code?
Okay i found out that i have to use the MessageEnitys and specify each word with an entity.
Could you share an example of code?
So the code example on the docs is what I used for the message.
`api.call('messages.sendMessage', { clear_draft: true,
peer: { _: 'inputPeerSelf', }, message: 'Hello @mtprotocore', entities: [ { : 'messageEntityBold', offset: 6, length: 13, }, ],
random_id: Math.ceil(Math.random() 0xffffff) + Math.ceil(Math.random() 0xffffff), });`
So the entities Array :
entities: [ { _: 'messageEntityBold', offset: 6, length: 13, }, ],
is for the formatting you can add a second object in that array for example messageEntityCode and set the offset to the specific letter in your message and the length of the word. Here are all possible message entities https://core.telegram.org/type/MessageEntity
Describe the bug I am trying to send a message with styled format, unfortuntley nothing seems to work, the messages are all send as a string only
Code example
Expected behavior A Message with a bold text.
Context:
Additional context Same happens when i use
parse_mode: "markup"
.