Skip to content

Instantly share code, notes, and snippets.

@gilbertw1
Created December 6, 2016 17:42
Show Gist options
  • Save gilbertw1/7abe262e3c0bb383e65ab97015b23f2e to your computer and use it in GitHub Desktop.
Save gilbertw1/7abe262e3c0bb383e65ab97015b23f2e to your computer and use it in GitHub Desktop.
package slack.rtm
import slack.api.BlockingSlackApiClient
import scala.concurrent.duration._
import akka.actor.{ ActorSystem, Props }
import SlackRtmConnectionActor._
object Main extends App {
val token = "<token>"
implicit val system = ActorSystem("test")
val client = BlockingSlackApiClient(token)
val state = RtmState(client.startRealTimeMessageSession())
val actor = system.actorOf(Props(new SlackRtmConnectionActor(token, state, 10.seconds)))
val handler = MessageHandlerActor(println)
actor ! AddEventListener(handler)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment