Closed Skarlso closed 11 months ago
Hey @todbot.
So I think I added this thing to everything. :D However, it's not working. The service doesn't seem to start up.
Is there something I'm missing here? I don't get any logs and events from the service at all. The Slack part of the code IS working; I tested that separately and saw messages arriving in the channel. I'm not sure what else could be missing. :)
Hi! I would check your personal blink1control2-config.json
and make sure it has the slackService
object and that it has an enabled: true
. Other than that, looks good so far!
Ah dang!! I added it to the defaults only after I first executed the dev env. :D So it wrote it out without the slack service 🤦.
ALSO! :D
It turns out that events aren't showing up!
This, for example:
try {
console.log("WHAT3")
token = utils.decrypt( self.config.password );
console.log("WHAT4")
} catch(err) {
console.log("ERR: ", err)
log.msg('SlackService: invalid user token for rule',rule.name);
return;
}
Didn't show me anything in the logs. Not until I added a console.log.
ERR: TypeError: Cannot read properties of undefined (reading 'split')
at Object.decrypt (utils.js:33:26)
at Object.start (slackService.js:69:21)
at eval (maingui.js:95:16)
Events said no logs..
Finally, I figured out that password
is the wrong value to look for. It's passwordHash
. :D
But now I'm getting:
xhr.js:143 Refused to set unsafe header "User-Agent"
It's working. :D
Sadly, I'm getting rate limited.
It's trying to connect over and over.. is there a way perhaps to reuse existing connections? Maybe through some state or something?
also, it looks like I need to use a different node client actually. rtm-api is now web-api.
Dang, it. The RTM is horrible. I will have to use the Events API. :( This means people will have to surface the call-back URL. Which is fine, I guess. You can use something like ngrok, which is quite common to open something up temporarily. Then, from there, using this and ngrok and pasting in the URL should be fine. If you have the app running anyways, you might as well start ngrok in the background for it.
What do you think?
Hello. I'm back. :D