Skip to content

Commit

Permalink
Moved HelpBot into core
Browse files Browse the repository at this point in the history
  • Loading branch information
marioosh committed Jul 2, 2015
1 parent 3d3be1c commit 0308054
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/main/scala/io/scalac/slack/bots/system/HelpBot.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package io.scalac.slack.bots.system

import io.scalac.slack.MessageEventBus
import io.scalac.slack.bots.AbstractBot
import io.scalac.slack.common.{Command, HelpRequest, OutboundMessage}

/**
* Maintainer: Patryk
*/
class HelpBot(override val bus: MessageEventBus) extends AbstractBot {
override def act: Receive = {
case Command("help", options, raw) =>
publish(HelpRequest(options.headOption, raw.channel))
}

override def help(channel: String): OutboundMessage = OutboundMessage(channel,
s"*$name* is for helping. Duh \\n" +
s"`help` - display help from all bots \\n " +
s"`help {botName}` - display help for certain bot module")
}

0 comments on commit 0308054

Please sign in to comment.