lib/robut/plugin/echo.rb in robut-0.2.1 vs lib/robut/plugin/echo.rb in robut-0.3.0

- old
+ new

@@ -1,14 +1,19 @@ - # A plugin that tells robut to repeat whatever he's told. -class Robut::Plugin::Echo < Robut::Plugin::Base +class Robut::Plugin::Echo + include Robut::Plugin # Responds with +message+ if the command sent to robut is 'echo'. def handle(time, sender_nick, message) words = words(message) if sent_to_me?(message) && words.first == 'echo' phrase = words[1..-1].join(' ') reply(phrase) unless phrase.empty? end end - + + # Returns a description of how to use this plugin + def usage + "#{at_nick} echo <message> - replies to the channel with <message>" + end + end