8000 GitHub - plvxn/tgraf-types · GitHub
[go: up one dir, main page]

Skip to content
forked from telegraf/types

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

Types for the Telegram Bot API

Bot API Version NPM version

TypeScript types for the Telegram Bot API. Fork of @telegraf/types with Bot API 9.5 support.

Zero executable code.

Installation

npm install --save-dev @plvxn/tgraf-types

Available Types

The package exposes interfaces that correspond to types used throughout the Telegram Bot API. Types like Update, Message, CallbackQuery, Chat, etc. are represented as unions for type narrowing.

Using API Response objects

The API wraps responses in an object with ok: boolean. This is modelled by the ApiResponse type.

Customizing InputFile

import * as Telegram from "@plvxn/tgraf-types";

type API = Telegram.ApiMethods<MyInputFile>;
type Opts<M extends keyof API> = Telegram.Opts<MyInputFile>[M];
type Ret<M extends keyof API> = Telegram.Ret<MyInputFile>[M];

Development

Written for Deno, built for Node. npm prepare runs deno2node.

Credits

Fork of @telegraf/types. Originally from Typegram.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0