X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=data%2Frbot%2Fplugins%2Fmarkov.rb;h=abbcb332f7d469c750bc4e4faa9d67680c1d82a5;hb=43ef0f794c062325be03a30ca609d4fcbeb5ae41;hp=3339eac0db071d1a844c0e6dd513ebeafb5d92c9;hpb=900623771ac00270992ab66f959ab679c09a5f1f;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/data/rbot/plugins/markov.rb b/data/rbot/plugins/markov.rb index 3339eac0..abbcb332 100644 --- a/data/rbot/plugins/markov.rb +++ b/data/rbot/plugins/markov.rb @@ -183,9 +183,11 @@ class MarkovPlugin < Plugin return unless word1 and word2 line = generate_string(word1, word2) return unless line - return if line == message + # we do nothing if the line we return is just an initial substring + # of the line we received + return if message.index(line) == 0 @bot.timer.add_once(delay) { - m.reply line + m.reply line, :nick => false, :to => :public } end @@ -257,3 +259,7 @@ plugin.map 'chat about :seed1 :seed2', :action => "chat" plugin.map 'chat', :action => "rand_chat" plugin.map 'markov probability [:probability]', :action => "probability", :requirements => {:probability => /^\d+%?$/} + +plugin.default_auth('ignore', false) +plugin.default_auth('probability', false) +