bub
Telegram bot framework
Please go through the Telegram Bot API first.
Get
npm install bub --save
Set
Try and keep your config in a separate JSON file, say bub.json
. That way, you can share your code without sharing your API token.
If your bot doesn't receive any messages for timeout
number of seconds, it will stop checking for more. Default is 10 days.
Go
var config = ;var Bub = ;var bot = config; var fs = ; // User commands are handled with `on()`bot; bot; // Anything without handlers goes herebot; // Start checking for updates and handle thembot;
Roadmap
- Add a convenience method
respond()
for quick responses - Improve
respond()
to send any kind of message based on the argument - Add webhook support
- Somewhere down the road: integrate a proper test framework and manage it with Gulp