meteor-slack-api
meteor-slack-api copied to clipboard
how to use the rtm start?
for the official API you can use
slack = new Slack(token, autoReconnect, autoMark)
I'm wondering if you've gone through the steps to get a websocket going after the API
SlackAPI.rtm.start(token, callback)
The url property contains a WebSocket Message Server URL. Connecting to this URL will initiate a Real Time Messaging session. These URLs are only valid for 30 seconds, so connect quickly!
about to start looking into that but asking here first!
Meteor.startup ->
if Meteor.isServer
slack = SlackAPI.rtm.start(token, startCb)
startCb = (err, res) ->
console.log("slack.start", err, res)
if err
console.error("cant start slack.rtm")
else
slack = res
# do something with it
I got as far as using joncursi:socket-io-client
and
slack = new io(res.url)
but can't seem to get any events to trigger on the connection...
This api will not automatically connect you to the real time messaging. It will only return the url. I can look into making this automatic.
Do you have a code sample of how you're using that URL?
AFAI understand opening the connection requires a Websocket
which requires importing other node packages, unless i'm missing something.