Class: HWPing::Bot

Inherits:
Object
  • Object
show all
Defined in:
lib/hwping/bot.rb

Constant Summary collapse

MESSAGES =
{
  :unauthorized => "Sorry, you're unauthorized to use this bot!",
  :firing       => 'Firing rocket in 5 seconds!',
  :notarget     => 'Unknown target!',
  :fire         => 'Rocket launch initiated!',
  :reset        => 'Launcher set back to default position!',
  :position     => 'Current position: %d %d',
  :target_list  => 'Available targets: %s',
  :target_get   => "Target's position: %d %d",
  :target_del   => 'Target successfully deleted!',
  :target_set   => "Target's position saved at: %d %d",
  :move         => 'Move operation finished!',
  :badcommand   => "Unknown command, type 'help' for further information!",
  :help         => "Hardware Pinger\n
    Usage in a channel: hwping <target>\n
    Available commands in private:\n
      help\n
      fire\n
      position\n
      up|down|left|right\n
      reset\n
      target list\n
      target set <nick> <right> <up>\n
      target get <nick>\n
      target del <nick>\n"
}

Instance Method Summary collapse

Constructor Details

#initialize(handler, config = {}) ⇒ Bot

Initialize a bot and return with its Cinch instance



34
35
36
37
38
39
40
41
# File 'lib/hwping/bot.rb', line 34

def initialize(handler, config = {})
  @nick     = config.nick
  @server   = config.server
  @port     = config.port
  @channels = config.channels.map { |m| "\##{m}"}
  @handler  = handler
  return setup_bot()
end