tgrm
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

tgrm

A minimal Telegram Bot API client

Read the docs

Usage

import { createClient, buildFormDataFor } from "tgrm";

const client = createClient({ token: "my-token" });

const message = await client.request("sendMessage", {
  chat_id: 123456789,
  text: "Hello, world!",
});

if (message.ok) {
  // Send a file!
  await client.request(
    "sendDocument",
    buildFormDataFor<"sendDocument">({
      chat_id: 123456789,
      reply_to_message_id: message.result.message_id,
      document: new File(["hello, world!"], "hello.txt"),
    })
  );
}

Readme

Keywords

none

Package Sidebar

Install

npm i tgrm

Weekly Downloads

75

Version

0.0.2

License

ISC

Unpacked Size

302 kB

Total Files

21

Last publish

Collaborators

  • schlez