Closed onlymejosh closed 8 years ago
Hey @onlymejosh my github notifications are wonky and I don't get these notifications -- trying to figure out why.
I haven't tried out the "Deploy to Heroku" button in a while, let me test it out and see if there's anything wrong. Can you please paste the output for heroku ps
in the meanwhile?
Hey @arunthampi no problem! I was actually going to email you as I see you offer hosting too? I'd like to chat about relax as I have a few questions too :)
Free quota left: 18h 0m
=== web (Free): relax (1)
web.1: up 2016/03/22 21:35:14 +0000 (~ 3s ago)
This is what I see in the logs:
2016-03-22T21:35:10.116088+00:00 heroku[web.1]: State changed from down to starting
2016-03-22T21:35:10.650228+00:00 heroku[web.1]: Starting process with command `relax`
2016-03-22T21:35:12.450842+00:00 app[web.1]: time="2016-03-22T21:35:12Z" level=info msg="connected to redis host" host="ec2-107-22-214-1.compute-1.amazonaws.com:18969" result=PONG
2016-03-22T21:35:12.452633+00:00 app[web.1]: 2016/03/22 21:35:12 Serving [::]:40472 with pid 3
2016-03-22T21:35:14.278951+00:00 heroku[web.1]: State changed from starting to up
2016-03-22T21:35:15.205868+00:00 heroku[router]: at=info method=GET path="/" host=lea-slack-controller.herokuapp.com request_id=5d104165-99b8-47af-a567-70106845e9bf fwd="86.181.145.20" dyno=web.1 connect=1ms service=2ms status=200 bytes=148
2016-03-22T21:35:15.448161+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=lea-slack-controller.herokuapp.com request_id=e583ceb0-071b-4a7a-b0de-b3e1ba2d12f8 fwd="86.181.145.20" dyno=web.1 connect=1ms service=2ms status=200 bytes=148
WARNING: Toolbelt v3.42.44 update available.
But I'm not seeing my bot online
Just checking did you start a bot with the Ruby client? https://github.com/zerobotlabs/relax-rb
and you can email me at arun@zerobotlabs.com for hosting questions :)
I didn’t I’m not going to be use ruby. I followed the guide on the relax README and ran
PUBLISH redis_bots_pubsub ' {"type":"team_added","team_id":"TDEADBEEF”}
did you also HSET
with team_id
and bot_token
? https://github.com/zerobotlabs/relax/#starting-bots
Yep heres my output
ec2-107-22-214-1.compute-1.amazonaws.com:18969> MULTI
OK
ec2-107-22-214-1.compute-1.amazonaws.com:18969> HSET redis_bots_key U03RK4N0A '{"team_id":"U03RK4N0A","token":"xoxp-MY-TOKEN"}'
QUEUED
ec2-107-22-214-1.compute-1.amazonaws.com:18969> HGETALL redis_bots_key
QUEUED
ec2-107-22-214-1.compute-1.amazonaws.com:18969> PUBLISH redis_bots_pubsub '{"type":"team_added","team_id":"U03RK4N0A"}'
QUEUED
ec2-107-22-214-1.compute-1.amazonaws.com:18969> EXEC
1) 1
2) T03RK4MV2,{"team_id":"T03RK4MV2", "token":"xoxb-26058478530-WZiSAiIljzkZvrvnC7hpmMXi"},U03RK4N0A,{"team_id":"U03RK4N0A","token":"xoxp-MY-TOKEN"}
3) 0
ec2-107-22-214-1.compute-1.amazonaws.com:18969>
I'm starting up a fresh relax install on Heroku to see what's going on, but in the mean time -- are you sure the team_id's are correct? the U03RK4N0A
ID looks like a user Id and not a team id.
You re correct! it wasn't a team id. I replaced it with the correct key and still no luck
looks like there was a typo in the documentatin which I fixed here! https://github.com/zerobotlabs/relax/commit/c7476d4b741c8b1d2966f5199ae5cc1769e2b491
By default the keys in Redis that you need to manipulate are relax_bots_key
and relax_bots_pubsub
and not redis_bots_key
and redis_bots_pubsub
. I've made those changes to the documentation. Thanks for catching it and let me know if that works.
also just curious -- what language do you intend to write your relax client in? would love to fill that gap. I have a todo for a node client
Awesome! Seems to be working now! I should of looked at the key names instead of blindly copying and pasting.
So I'm actually using botkit at the moment but am not happy with it. I'm generally a ruby developer but I want to use node so the library would be great!
I checked out relax-rb
and it looks like you post messages to the relax pubsub. https://github.com/zerobotlabs/relax-rb/blob/master/lib/relax/bot.rb#L38 How does this work?
I really like the use of redis for queues it seems like the best way to handle messages in and out. Have you thought about handling conversations?
I checked out relax-rb and it looks like you post messages to the relax pubsub. https://github.com/zerobotlabs/relax-rb/blob/master/lib/relax/bot.rb#L38 How does this work?
Because you can run multiple instances of Relax (on multiple dynos for e.g.) and it should act like one instance of Relax, i use pubsub so that all instances get messages. There's a pubsub listener on relax that listens on the pubsub channel.
I really like the use of redis for queues it seems like the best way to handle messages in and out.
Haha funny you mention it, I was thinking of a different protocol (for e.g. websockets)
Have you thought about handling conversations?
I have, but I think it might be outside the scope of relax. I think this should be handled by the app, but if there ways I can make that easier, I'm open to suggestions.
Thanks for your feedback! Closing the issue for now, open new ones if you run into other issues or email me.
Hey there,
I came across relax last night and am really excited to be using it! I was actually planning on building my own with a very similar architecture until I came across relax!
I've fallen over at the first hurdle though. I used the deploy to heroku button adding my team and bot to redis. My bot however is still offline, have I missed something?
I'm seeing this in the logs if that helps