hal icon indicating copy to clipboard operation
hal copied to clipboard

question about the hook url's (and also a point about client.PostForm() error processing)

Open djosephsen opened this issue 11 years ago • 1 comments

Hey, one more (hopefully) question.. I have stuff pretty much setup using the hubot integration, but I'm not getting any replies from hal.

I forked hal and added some additional debugging and found two things:

First, Hal was using whitelist behavior by default, so I had to set HAL_SLACK_CHANNEL_MODE=blacklist, which, I thought I'd mention as a new user because this wasn't documented very well. (I'd be happy to PR you some documentation if there's an easy way to do that)

Second, adding debugging to SendHTTP I see that my handler replies are, in fact, exiting hal, and they look pretty much like what I'd expect:

2014-12-02T23:01:45.421916+00:00 app[web.1]: 2014-12-02T23:01:45Z [hal] DEBUG: u is: https://hustlebotdev.slack.com/services/hooks/incoming-webhook?token=XXXXX 2014-12-02T23:01:45.421981+00:00 app[web.1]: 2014-12-02T23:01:45Z [hal] DEBUG: payload is: {"channel":"XXXX","username":"bob","text":":arrow_up: you complete me :arrow_up:"}

But they're being rejected by Slack. Transforming this into a CURL command like so:

curl -k -X POST --data-urlencode 'payload={"channel":"XXXX","username":"bob","text":":arrow_up: you complete me :arrow_up:"}' https://hustlebotdev.slack.com/services/hooks/incoming-webhook?token=XXXXX

and sending this manually, I get the following response from slack: "No hooks"

So my first comment is, It'd be awesome if I could have gotten the 'no hooks' error back from hal's client.PostForm() call instead of having to fork, change namespaces, add debugging, and etc..

and secondly, I'm wondering if you have any notion of why that post didn't work. No Hooks? I obviously have the hubot integration turned on.. is hal trying to post to an out of date hook url?

Thanks for making this and helpin out a newb!

djosephsen avatar Dec 02 '14 23:12 djosephsen

Sorry about that huge rambling poorly-worded problem description. I was evidently off my meds that day.

djosephsen avatar Dec 03 '14 21:12 djosephsen