X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=data%2Frbot%2Fplugins%2Fremind.rb;h=6ce179c49a8694371f30bf1e28e322748da07de0;hb=b40ac172a32b71f1edc4e8b5992a4844e8eb6678;hp=0c0841f6f9457c64ff7b047a9bfc1e03f34c790c;hpb=9d29f400bb3a354779185d61049ce7cdfa7744ee;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/data/rbot/plugins/remind.rb b/data/rbot/plugins/remind.rb index 0c0841f6..6ce179c4 100644 --- a/data/rbot/plugins/remind.rb +++ b/data/rbot/plugins/remind.rb @@ -1,5 +1,3 @@ -require 'rbot/utils' - class RemindPlugin < Plugin # read a time in string format, turn it into "seconds from now". # example formats handled are "5 minutes", "2 days", "five hours", @@ -138,14 +136,12 @@ class RemindPlugin < Plugin if(repeat) @reminders[who][subject] = @bot.timer.add(period) { - time = Time.now + period - tstr = time.strftime("%H:%M:%S") + tstr = (Time.now + period).strftime("%H:%M:%S") @bot.say who, "repeat reminder (next at #{tstr}): #{subject}" } else @reminders[who][subject] = @bot.timer.add_once(period) { - time = Time.now + period - tstr = time.strftime("%H:%M:%S") + tstr = Time.now.strftime("%H:%M:%S") @bot.say who, "reminder (#{tstr}): #{subject}" } end