X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=data%2Frbot%2Fplugins%2Fseen.rb;h=704b83241a9d5a9ba659f8481643efe6e2eda8e0;hb=1e841175468b3e0357ab278a226a237fe4d7687e;hp=3c9218382d3413e4cc4dc54f695f23a24137c387;hpb=127d9152199cac9b431586bb7b17f6f297b6864f;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/data/rbot/plugins/seen.rb b/data/rbot/plugins/seen.rb index 3c921838..704b8324 100644 --- a/data/rbot/plugins/seen.rb +++ b/data/rbot/plugins/seen.rb @@ -1,4 +1,4 @@ -Saw = Struct.new("Saw", :nick, :time, :type, :where, :message) unless defined?(Seen::Saw) +define_structure :Saw, :nick, :time, :type, :where, :message class SeenPlugin < Plugin def help(plugin, topic="") @@ -67,20 +67,20 @@ class SeenPlugin < Plugin ret += Utils.secs_to_string(ago) + " ago, " end - case saw.type - when "PUBLIC" + case saw.type.to_sym + when :PUBLIC ret += "saying #{saw.message}" - when "ACTION" + when :ACTION ret += "doing #{saw.nick} #{saw.message}" - when "NICK" + when :NICK ret += "changing nick from #{saw.nick} to #{saw.message}" - when "PART" + when :PART ret += "leaving #{saw.where}" - when "JOIN" + when :JOIN ret += "joining #{saw.where}" - when "QUIT" + when :QUIT ret += "quitting IRC (#{saw.message})" - when "TOPIC" + when :TOPIC ret += "changing the topic of #{saw.where} to #{saw.message}" end end