Skip to content

Instantly share code, notes, and snippets.

@vito-c
Created March 6, 2016 18:32
Show Gist options
  • Save vito-c/6508919ff23586e93fb3 to your computer and use it in GitHub Desktop.
Save vito-c/6508919ff23586e93fb3 to your computer and use it in GitHub Desktop.
much case very none
class Knocker extends Actor with ActorLogging {
import scala.concurrent.ExecutionContext.Implicits.global
def receive: Receive = {
case imsg:IMessage =>
KnockKnock(imsg) match {
case Some(knock) =>
knock.target match {
case Some(nick) =>
V2D2.nickMap onSuccess {
case nm =>
nm get (nick.trim) match {
case Some(user) =>
context.parent ! s"Knock, knock @${nick}!"
case _ =>
context.parent ! s"Nice try silly human."
}
}
case _ => None
}
case _ => None
}
case _ => None
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment