https://github.com/evermake/tgx
JSX for Telegram messages.
https://github.com/evermake/tgx
jsx telegram telegram-bots
Last synced: about 1 month ago
JSON representation
JSX for Telegram messages.
- Host: GitHub
- URL: https://github.com/evermake/tgx
- Owner: evermake
- License: mit
- Created: 2024-03-22T22:27:55.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-26T19:51:12.000Z (about 2 months ago)
- Last Synced: 2025-04-22T06:44:36.383Z (about 1 month ago)
- Topics: jsx, telegram, telegram-bots
- Language: TypeScript
- Homepage: https://jsr.io/@evermake/tgx
- Size: 666 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

Implementation of `jsx-runtime` to create Telegram messages using JSX.
## Installation
```sh
deno add jsr:@evermake/tgx
# or
npx jsr add @evermake/tgx
# or
pnpm dlx jsr add @evermake/tgx
# or
yarn dlx jsr add @evermake/tgx
# or
bunx jsr add @evermake/tgx
```Then in your `tsconfig.json`:
```jsonc
{
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "@evermake/tgx",
// ...
}
}
```## Example
Usage with [grammY](https://grammy.dev):
```tsx
import { html } from '@evermake/tgx'
import { Bot } from 'grammy'const Greeting = (props: { name: string }) => (
<>Hello, {props.name}!>
)const bot = new Bot(/* TOKEN */)
bot.command('start', async (ctx) => {
await ctx.reply(
html(),
{ parse_mode: 'HTML' }
)
})bot.start()
```## License
[MIT](./LICENSE)