diff --git a/scripts/telegram.coffee b/scripts/telegram.coffee index f59e92c..78ea317 100644 --- a/scripts/telegram.coffee +++ b/scripts/telegram.coffee @@ -16,15 +16,15 @@ net = require 'net' -port = process.env['HUBOT_TG_PORT'] || 1123 -host = process.env['HUBOT_TG_HOST'] || 'localhost' - module.exports = (robot) -> + + console.log robot.host # directly run a command in telegram-cli and return its output # (a list of strings) run_command = (command, callback) -> - client = net.connect port, host, -> client.write command+'\n' + client = net.connect robot.adapter.port, robot.adapter.host, -> + client.write command+'\n' client.setEncoding 'utf8' client.on 'data', (reply) -> if callback?