X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=data%2Frbot%2Fplugins%2Fsalut.rb;h=abcb17443b4fc7af4d9ecdf8b2d8620d22d7148f;hb=24bb60775741d3731400f1e430ef6bf3a2e1b933;hp=b0bf67e7769fd47d0cc5ecf80d75bc93161e6383;hpb=64689811ca5ee4e190d1837463675c68f9a094ff;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/data/rbot/plugins/salut.rb b/data/rbot/plugins/salut.rb index b0bf67e7..abcb1744 100644 --- a/data/rbot/plugins/salut.rb +++ b/data/rbot/plugins/salut.rb @@ -1,16 +1,25 @@ -# vim: set sw=2 et: +#-- vim:sw=2:et +#++ +# +# :title: Salutations plugin for rbot +# +# Author:: Giuseppe "Oblomov" Bilotta +# Copyright:: (C) 2006-2007 Giuseppe Bilotta +# License:: GPL v2 +# # Salutations plugin: respond to salutations -# TODO allow online editing of salutations -# TODO *REMEMBER* to set @changed to true after edit -# TODO or changes won't be saved +# +# TODO:: allow online editing of salutations +# +# TODO:: *REMEMBER* to set @changed to true after edit or changes won't be saved class SalutPlugin < Plugin - BotConfig.register BotConfigBooleanValue.new('salut.all_languages', + Config.register Config::BooleanValue.new('salut.all_languages', :default => true, :desc => "Check for a salutation in all languages and not just in the one defined by core.language", :on_change => Proc.new {|bot, v| bot.plugins['salut'].reload} ) - BotConfig.register BotConfigBooleanValue.new('salut.address_only', + Config.register Config::BooleanValue.new('salut.address_only', :default => true, :desc => "When set to true, the bot will only reply to salutations directed at him", :on_change => Proc.new {|bot, v| bot.plugins['salut'].reload} @@ -82,7 +91,7 @@ class SalutPlugin < Plugin @match_langs.uniq! end - def listen(m) + def unreplied(m) return if @match.empty? return unless m.kind_of?(PrivMessage) return if m.address? and m.plugin == 'config'