lib/robut/plugin/ping.rb in robut-0.2.1 vs lib/robut/plugin/ping.rb in robut-0.3.0
- old
+ new
@@ -1,11 +1,15 @@
-
# A simple plugin that replies with "pong" when messaged with ping
-class Robut::Plugin::Ping < Robut::Plugin::Base
+class Robut::Plugin::Ping
+ include Robut::Plugin
+ def usage
+ "#{at_nick} ping - responds 'pong'"
+ end
+
# Responds "pong" if +message+ is "ping"
def handle(time, sender_nick, message)
words = words(message)
reply("pong") if sent_to_me?(message) && words.length == 1 && words.first.downcase == 'ping'
end
-
+
end