Class: Daneel::Scripts::Echo

Inherits:
Daneel::Script show all
Defined in:
lib/daneel/scripts/echo.rb

Instance Attribute Summary

Attributes inherited from Plugin

#robot

Instance Method Summary collapse

Methods inherited from Daneel::Script

#accepts?, files, inherited, list

Methods inherited from Plugin

#initialize, #logger, requires_env

Constructor Details

This class inherits a constructor from Daneel::Plugin

Instance Method Details

#helpObject



15
16
17
# File 'lib/daneel/scripts/echo.rb', line 15

def help
  {"echo TEXT" => "are you copying me? stop copying me!"}
end

#receive(room, message, user) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/daneel/scripts/echo.rb', line 7

def receive(room, message, user)
  case message.command
  when /^(?:echo|say)\s(.+)/
    room.say $1
    message.done!
  end
end