Use variables defined by the adapter
This commit is contained in:
parent
d66080f531
commit
1fadad01de
@ -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?
|
||||
|
Loading…
Reference in New Issue
Block a user