summaryrefslogtreecommitdiff
path: root/data/rbot
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2010-09-27 12:38:59 +0200
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2010-09-27 12:38:59 +0200
commit284bcbf4b29184717cd2e0986d4c2007ee6a930c (patch)
tree69a092092aa08902c949a9df7781151d1b5b3918 /data/rbot
parentd38bad05f1a36c588d78e2b8b60fb3710c0325bd (diff)
time: support POSIX time
Diffstat (limited to 'data/rbot')
-rw-r--r--data/rbot/plugins/time.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/data/rbot/plugins/time.rb b/data/rbot/plugins/time.rb
index 854e403d..efea466f 100644
--- a/data/rbot/plugins/time.rb
+++ b/data/rbot/plugins/time.rb
@@ -159,8 +159,12 @@ class TimePlugin < Plugin
offset = (time - now).abs
raise if offset < 0.1
rescue => e
- m.reply _("unintelligible time")
- return
+ if str.match(/^\d+$/)
+ time = Time.at(str.to_i)
+ else
+ m.reply _("unintelligible time")
+ return
+ end
end
if zone = @registry[m.sourcenick]