@botocrat/core
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

Botocrat Framework

NodeJS npm size last commit license mit vulnerabilities Total alerts Code quality

Botocrat animation

Botocrat is a minimal and flexible Telegram bot framework that provides context oriented programming API along with express-like middlewares.

Botocrat has following packages you can use or replace with your own.

Package
@botocrat/telegram Telegram Bot Client
@botocrat/poller Polls Telegram server to .getUpdates()
@botocrat/express Express middleware to receive updates from webhook
@botocrat/state Persistent/volatile state (stored in redis) management middleware (coming soon)

Features

Quick Start (cli)

npm exec botocrat my-telegram-bot

Quick Start (manual)

npm i @botocrat/core @botocrat/telegram @botocrat/poller --save
import Botocrat from '@botocrat/core'
import createClient from '@botocrat/telegram'
import poller from '@botocrat/poller'

const client = createClient({token: TELEGRAM_BOT_TOKEN})

const bot = new Botocrat()
  .get('message', (req, res) => {
    res.send(`Hello ${req.from.first_name}!`)
    // .sent.wait(1000).reply('Thank you for choosing us')
  })

poller(bot, client).poll()

Documentation

Read the detailed documentation on GitHub Wiki

License

MIT License

Package Sidebar

Install

npm i @botocrat/core

Weekly Downloads

6

Version

0.2.1

License

MIT

Unpacked Size

23.6 kB

Total Files

20

Last publish

Collaborators

  • alperkursat