tg_bot
v0.0.6
Published
Telegram Bot: simple async interface
Downloads
4
Readme
Simple Async-oriented Telegram Bot
Bot has simplify interface for fast creating telegram bots. Events, expect and other.
Installation
npm install tg_bot
Integration
var TelegramBot = require('tg_bot');
var bot = new TelegramBot('YOUR_TELEGRAM_BOT_TOKEN');
bot.on('*',function(message, chat){ //In all events callback receive objects [Message](#Message) and [Chat](#Chat)
// your logic here ...
chat.sendMessage("Hello!",function(error){
console.error(error);
});
})
#API
Telegram Bot builded on node-telegram-bot-api
- TelegramBot
- Chat
- chat.initialize(callback)
- chat.sendMessage(text [, options], callback)
- chat.sendAction(action, callback)
- chat.getId()
- chat.getType()
- chat.sendMarkdown()
- chat.disablePagePreview()
- chat.replyTo(Message or messageId)
- chat.createHideKeyboard(selective)
- chat.createForceReply(selective)
- chat.createKeyboard(oneTime, selective, resize)
- chat.removeReplyMarkup()
- Message