X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=data%2Frbot%2Fplugins%2Fkeywords.rb;h=6ace2016bf0e55c2da3020f0c5c5c74633a88788;hb=b40ac172a32b71f1edc4e8b5992a4844e8eb6678;hp=855bfe6aa4e25bb4472ed839be7621a923fde5b1;hpb=da4d97f0652bddcee269b6d99863f21a1021056c;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/data/rbot/plugins/keywords.rb b/data/rbot/plugins/keywords.rb index 855bfe6a..6ace2016 100644 --- a/data/rbot/plugins/keywords.rb +++ b/data/rbot/plugins/keywords.rb @@ -117,13 +117,6 @@ class Keywords < Plugin end end - # drop static keywords and reload them from files, picking up any new - # keyword files that have been added - def rescan - @statickeywords = Hash.new - scan - end - # load static keywords from files, picking up any new keyword files that # have been added def scan @@ -490,11 +483,9 @@ class Keywords < Plugin end def unreplied(m) - # return if m.address? - # in channel message, not to me # TODO option to do if(m.message =~ /^(.*)$/, ie try any line as a # keyword lookup. - if !@bot.config["keyword.address"] && m.message =~ /^(.*\S)\s*\?\s*$/ + if m.message =~ /^(.*\S)\s*\?\s*$/ and (m.address? or not @bot.config["keyword.address"]) keyword_lookup m, $1, true if @bot.auth.allow?("keyword", m.source) elsif @bot.config["keyword.listen"] && (m.message =~ /^(.*?)\s+(is|are)\s+(.*)$/) # TODO MUCH more selective on what's allowed here