TypeScript types for Telegram Bot Api and Telegram Mini Apps
npm install @effect-ak/tg-bot-api!Telegram Bot API
!Telegram WebApp

- Complete and Up-to-Date Telegram Bot API: The entire API is generated from the official documentation using a code generator, ensuring this client remains in sync and supports every method and type provided by the Telegram Bot API.
- Types for Webapps Types that describe Telegram.WebApp. Created by code generator as well.
- ChatBot runner: Focus on the logic of your chat bot
- Type Mapping: Types from the documentation are converted to TypeScript types:
- Integer → number
- True → boolean
- String or Number → string | number
- Enumerated types, such as "Type of the chat can be either “private”, “group”, “supergroup” or “channel”", are converted to a standard union of literal types "private" | "group" | "supergroup" | "channel"
- And more...
Telegram provides a big html page that describes Telegram.WebApp
``typescript
import type { WebApp } from "@effect-ak/tg-bot-client/webapp"
interface Telegram {
WebApp: TgWebApp
}
declare const Telegram: Telegram
const saveData = () => {
Telegram.WebApp.CloudStorage.setItem("key1", "some data", (error) => {
if (error == null) {
console.log("Saved!")
}
})
}
``