Created
April 2, 2018 12:27
-
-
Save dionarya23/aa326ff1997216a406369ccbd621d6bd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Telegram = require('node-telegram-bot-api'); | |
const dbot = require('dbot-js') | |
const token = 'TELEGRAM_TOKEN' | |
const ksatria_bot = new TelegramBot(token, { polling: true }); | |
ksatria_bot.on('message', function(msg) { | |
var chatId = msg.chat.id; | |
var message = msg.text.toString() | |
dbot.get_response(message, function(err, result){ | |
if (!err) { | |
ksatria_bot.sendMessage(chatId, result) | |
} | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment