From 6b7ff075e409cb548224c9e6fa3069062a2cfe34 Mon Sep 17 00:00:00 2001 From: Luke Slater Date: Sat, 4 Apr 2015 02:29:48 +0300 Subject: [PATCH 1/2] Update rss.js lol --- modules/rss/rss.js | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/rss/rss.js b/modules/rss/rss.js index f6aa9ea..eda2100 100644 --- a/modules/rss/rss.js +++ b/modules/rss/rss.js @@ -13,7 +13,6 @@ var rss = function(dbot) { this.internalAPI = { 'makeRequest': function(id,feed) { - dbot.say(feed.server,feed.channel,"RSS: I am making a request for feed "+feed.name+" to "+feed.url+" and I like it."); var fid = id, req = request(feed.url), feedparser = new FeedParser(); From 64bffd534e4505d6dbca9217ed9a8fcbeef82dd8 Mon Sep 17 00:00:00 2001 From: amki Date: Sun, 5 Apr 2015 19:34:04 +0200 Subject: [PATCH 2/2] Added remind module with ~remind and ~remindme commands --- modules/remind/README.md | 20 +++++++++++ modules/remind/remind.js | 73 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 modules/remind/README.md create mode 100644 modules/remind/remind.js diff --git a/modules/remind/README.md b/modules/remind/README.md new file mode 100644 index 0000000..1eee130 --- /dev/null +++ b/modules/remind/README.md @@ -0,0 +1,20 @@ +## Remind + +Reminder! + +### Description +This module reminds you! + +### TIME +The TIME parameter for this module needs to be in a fashion NdNhNmNs. +Example: 4d3h2m1s +You can give skip parameters if you like. (Example: 4d5m) + +### Commands + +#### ~remind [USER] [TIME] [MESSAGE] +Reminds you in now+TIME with message [MESSAGE] + +#### ~remindme [TIME] [MESSAGE] +Reminds the given user in now+TIME with message [MESSAGE] + diff --git a/modules/remind/remind.js b/modules/remind/remind.js new file mode 100644 index 0000000..ddf1c11 --- /dev/null +++ b/modules/remind/remind.js @@ -0,0 +1,73 @@ +/** + * Module Name: Remind + * Description: Reminds you + */ + +var remind = function(dbot) { + var self = this; + + this.internalAPI = { + 'getSeconds': function(number,interval) { + switch(interval) { + case "d": + return number*24*60*60; + case "h": + return number*60*60; + case "m": + return number*60; + case "s": + return number; + } + }.bind(this), + 'doReminder': function(event,user,time,message) { + var now = Date.now(); + var datesplits = time.match(/[0-9]+[dhms]/g); + if(datesplits == null) { + event.reply("The time parameter was not a valid time mah boy, it was "+time); + return; + } + var timeinseconds = 0; + for(var i=0;i