Hubot adapter for Symphony developed by the Symphony Foundation
You must pass the following environment variables to hubot
HUBOT_SYMPHONY_HOST
set to the url of your pod without the https:// prefixHUBOT_SYMPHONY_PUBLIC_KEY
set to the location of your bot account .pem public key fileHUBOT_SYMPHONY_PRIVATE_KEY
set to the location of your bot account .pem private key fileHUBOT_SYMPHONY_PASSPHRASE
set to the passphrase associated with your bot account private key
These arguments are passed through to the NodeJs request module as described here.
If you want to send a rich message you can call send with an Object instead of a String
module.exports = (robot) ->
robot.respond /pug me/i, (msg) ->
msg.http("http://pugme.herokuapp.com/random")
.get() (err, res, body) ->
pug = JSON.parse(body).pug
msg.send pug
msg.send {
format: 'MESSAGEML'
text: "<messageML><a href=\"#{pug}\"/></messageML>"
}
A simple diagnostic script is included to help confirm that you have all the necessary pieces to get started. You can run this as follows:
npm install hubot-symphony
npm run diagnostic -- --publicKey [key1.pem] --privateKey [key2.pem] --passphrase [changeit] --host [host.symphony.com]
If the script runs as expected it will obtain and log both session and key manager tokens, look up and log some details of the bot account and then create a datafeed and poll. If you send a message using the Symphony client to the bot account you should see the details logged.
The privateKey.pem and publicKey.pem files under test/resources have been generated at random and are not real keys.