1.3.1 • Published 9 months ago

telegram-jsx v1.3.1

Weekly downloads
-
License
Unlicense
Repository
github
Last release
9 months ago

Telegram JSX

TSX/JSX runtime for telegram bots

Installation

  1. Run:
    npm install telegram-jsx
  2. Set these properties in tsconfig.json
    {
      "jsx": "react-jsx",
      "jsxImportSource": "telegram-jsx",
      "include": ["node_modules/telegram-jsx/index.d.ts"]
    }

Usage

Now you can create components and use TSX

import { Paragraph } from "telegram-jsx";

export function Ul({ children }: { children: Iterable<JSX.Child> }) {
  return (
    <>
      {[...children].filter(Boolean).map((value) => (
        <Paragraph>
          <i>•</i> {value}
        </Paragraph>
      ))}
    </>
  );
}
telegram.updates.on("message", (context) =>
  context.reply((<b>yoo!</b>).toString())
);
1.3.1

9 months ago

1.3.0

9 months ago

1.2.0

11 months ago

1.1.0

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago