@botocrat/poller
v1.0.0
Published
Telegram server poller for Botocrat
Downloads
5
Maintainers
Readme
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