Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexxandergrib/telegram-jsx
TSX/JSX runtime for telegram bots
https://github.com/alexxandergrib/telegram-jsx
bot components formatting jsx telegram tsx
Last synced: about 2 months ago
JSON representation
TSX/JSX runtime for telegram bots
- Host: GitHub
- URL: https://github.com/alexxandergrib/telegram-jsx
- Owner: AlexXanderGrib
- License: unlicense
- Created: 2023-11-03T08:08:04.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-15T15:48:47.000Z (3 months ago)
- Last Synced: 2024-10-16T19:46:07.003Z (3 months ago)
- Topics: bot, components, formatting, jsx, telegram, tsx
- Language: JavaScript
- Homepage: https://npmjs.com/package/telegram-jsx
- Size: 51.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Telegram JSX
TSX/JSX runtime for telegram bots
## Installation
1. Run:
```bash
npm install telegram-jsx
```
2. Set these properties in `tsconfig.json`
```json
{
"jsx": "react-jsx",
"jsxImportSource": "telegram-jsx",
"include": ["node_modules/telegram-jsx/index.d.ts"]
}
```## Usage
Now you can create components and use TSX
```tsx
import { Paragraph } from "telegram-jsx";export function Ul({ children }: { children: Iterable }) {
return (
<>
{[...children].filter(Boolean).map((value) => (
• {value}
))}
>
);
}
``````tsx
telegram.updates.on("message", (context) =>
context.reply((yoo!).toString())
);
```