X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=data%2Frbot%2Fplugins%2Fremind.rb;h=1c1a21a93fc356cdf8f42583a98e275d9e387b75;hb=3c7811f959988c7e7d10a730f8309f48b766fc6b;hp=5ad980aeac8d33012da673e0c0594796d8100f32;hpb=21949774b91eaec6ecde4eaa8ad121e2c0a36b87;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/data/rbot/plugins/remind.rb b/data/rbot/plugins/remind.rb index 5ad980ae..1c1a21a9 100644 --- a/data/rbot/plugins/remind.rb +++ b/data/rbot/plugins/remind.rb @@ -1,6 +1,13 @@ -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", + # "11:30", "15:45:11", "one day", etc. + # + # Throws:: RunTimeError "invalid time string" on parse failure + def timestr_offset(timestr) + Utils.parse_time_offset(timestr) + end + def initialize super @reminders = Hash.new @@ -12,17 +19,14 @@ class RemindPlugin < Plugin } } @reminders.clear + super end def help(plugin, topic="") - if(plugin =~ /^remind\+$/) - "see remind. remind+ can be used to remind someone else of something, using instead of 'me'. However this will generally require a higher auth level than remind." - else - "remind me [about] in