I’m trying to get this Slack library working in a Phoenix project. I’ve got the handles set up in a channel, I’ve got the channel listed in the user_socket.ex file, but I’m not sure how the start_link method would be different.
Well I would put the start_link part in a supervisor like so:
worker(Slack.Bot, [SlackRtm, [], "token"]), # or something like that
And I’d give it a {:local, Blah} name too so I could reference it from anywhere.
And the ‘send’ call to be in whatever should send it using that Blah local name. ^.^
Or just put it all in a GenServer.
I have a discord bot in elixir, I should put it on github sometime as it would work pretty similar as a tutorial’ish for a slack bot too…
Went ahead and uploaded it. It is not a shining beacon of code design, everything there was written in about an hour ‘just to get it done’ since it was for a personal project. ^.^;
But I start the discord library as a worker in my project at:
I also start up an IRC connection worker before it (I needed an IRC bridge) and a Command worker below it (to handle bot commands).
I think I figured out a short while later that I wanted to do with Slack at the time was not possible and ended up dropping the whole thing. I don’t believe I ever did figure it out, tried looking for the project but seems I deleted it. Sorry I can’t be of more help.