3
0
mirror of https://github.com/reality/dbot.git synced 2024-12-26 12:42:51 +01:00

Merge pull request #644 from amki/remind

Remind now supports messages with spaces and calls the user reminding you
This commit is contained in:
Luke Slater 2015-04-05 20:50:07 +03:00
commit 37d5fca1af

View File

@ -37,10 +37,19 @@ var remind = function(dbot) {
event.reply("The timer will be at "+then);
}
var cb = function() {
if(message)
event.reply(user+": This is your reminder. You left a message: "+message);
else
event.reply(user+": This is your reminder. You did not leave a message.");
if(message) {
if(event.user === user) {
event.reply(user+": This is your reminder. You left a message: "+message);
} else {
event.reply(user+": This is your reminder. "+event.user+" left a message: "+message);
}
} else {
if(event.user === user) {
event.reply(user+": This is your reminder. You did not leave a message.");
} else {
event.reply(user+": This is your reminder. "+event.user+" did not leave a message.");
}
}
};
dbot.api.timers.addTimeout(then,cb,null);
if(message)
@ -56,14 +65,14 @@ var remind = function(dbot) {
event.reply("You need to give me a user and time dude.");
return;
}
this.internalAPI.doReminder(event,event.params[1],event.params[2],event.params[3]);
this.internalAPI.doReminder(event,event.params[1],event.params[2],event.params.splice(3, event.params.length-1).join(' ').trim());
},
'~remindme': function(event) {
if(event.params.length < 2) {
event.reply("You need to give me a time dude.");
return;
}
this.internalAPI.doReminder(event,event.user,event.params[1],event.params[2]);
this.internalAPI.doReminder(event,event.user,event.params[1],event.params.splice(2, event.params.length-1).join(' ').trim());
}
};
};