Skip to content

Commit

Permalink
Update documentation on how to use message entities
Browse files Browse the repository at this point in the history
  • Loading branch information
BubuMVX committed Oct 14, 2024
1 parent cc8f224 commit c185814
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,23 @@ const menuTemplate = new MenuTemplate<MyContext>((ctx) => {
});
```

### Can I use entities or `grammyjs/parse-mode` in the message body?

Yes, you can pass the option `entities`.

This will be resolved automatically to`caption_entities` if you send a `media` message.

```ts
const menu = new MenuTemplate<MyContext>(async () => {
const message = fmt`${bold(underline('Hello world!'))}`

return {
text: message.text,
entities: message.entities,
};
});
```

### Can the menu body be some media?

The menu body can be an object containing `media` and `type` for media.
Expand Down

0 comments on commit c185814

Please sign in to comment.