@gramio/format
Version:
Library for formatting text for Telegram Bot API
25 lines (16 loc) • 863 B
Markdown
# @gramio/format
Library for [formatting](https://core.telegram.org/bots/api#messageentity) text for Telegram Bot API. Used under the hood by [GramIO](https://gramio.dev/) framework but it framework-agnostic.
[](https://www.npmjs.org/package/@gramio/format)
[](https://jsr.io/@gramio/format)
[](https://jsr.io/@gramio/format)
## Usage
```ts
bot.api.sendMessage({
chat_id: 12321,
text: format`${bold`Hi!`}
Can ${italic("you")} help ${spoiler`me`}?
Can you give me a ${link("star", "https://github.com/gramiojs/gramio")}?`,
});
```

## See [Documentation](https://gramio.dev/formatting.html)