UNPKG

@botocrat/poller

Version:

Telegram server poller for Botocrat

31 lines (20 loc) 757 B
# Botocrat Poller This is a helper library for [Botocrat Bot Framework](https://github.com/botocrats/core) - 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](https://npmjs.com/package/@botocrat/express) instead) ```typescript 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