1.0.0 • Published 3 years ago

@botocrat/poller v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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