Skip to content

timnikolsky/tgkit

Repository files navigation

TgKit Logo

TgKit

License Telegram Bot API version

About

Warning

This library is under development! It doesn't yet cover Telegram Bot API 100% and may contain bugs. Library API may change at any time. Use it in production at your own risk.
None of the code is generated. Every type and structure is hand-written, hence there can be some mistakes. Please open an issue if you find any!

TgKit is library for interacting with Telegram Bot API

Features

  • Lightweight
  • Object-oriented, has predictable abstractions and Typescript type defentitions included

Example

import { Client } from 'tgkit'

const client = new Client({
    // Create bot and get token via @botfather
    token: '0123456789:PUtY0uR0WNT37egR4m8oTtOk3NHer3-tMnK'
})

client.on('message', async (message) => {
    if (message.text.startsWith('/start')) {
        await message.chat.sendMessage('Hello World! I\'m a brand new TgKit bot')
        await message.chat.sendMessage('✌️')
    }
})

client.polling.start()