lib/robut/plugin/ping.rb in robut-0.3.0 vs lib/robut/plugin/ping.rb in robut-0.4.0
- old
+ new
@@ -1,15 +1,9 @@
# A simple plugin that replies with "pong" when messaged with ping
class Robut::Plugin::Ping
include Robut::Plugin
- def usage
- "#{at_nick} ping - responds 'pong'"
+ desc "ping - responds 'pong'"
+ match /^ping$/, :sent_to_me => true do
+ reply("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