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

1.0.0 • Public • Published

Botocrat Poller

This is a helper library for Botocrat Bot Framework

  • Polls Telegram server to receive bot updates
  • Created for quick starting in development/test environment.
  • DON'T USE THIS LIBRARY IN PRODUCTION (use Botocrat Express instead)
import Botocrat from "@botocrat/core"
import createClient from "@botocrat/telegram"
import receiveUpdates from "@botocrat/poller"

const client = createClient({token: TELEGRAM_BOT_TOKEN})
const bot = new Botocrat()
  .get("message", (req, res) => 
    res.reply("Hello " + req.from.first_name))

receiveUpdates(bot, client, 1000).poll()

Methods

poll()

Start polling

stop()

Stop polling

Package Sidebar

Install

npm i @botocrat/poller

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

2.55 kB

Total Files

4

Last publish

Collaborators

  • alperkursat