-
-
Save buritica/5088372 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = (robot) -> | |
robot.brain.data.tell_messages ?= {} | |
localstorage = robot.brain.data.tell_messages | |
robot.respond /tell ([\w.-]*) (.*)/i, (msg) -> | |
datetime = new Date() | |
tellmessage = msg.match[1] + ": " + msg.message.user.name + " @ " + datetime.toTimeString() + " said: " + msg.match[2] + "\r\n" | |
if localstorage[msg.match[1]] == undefined | |
localstorage[msg.match[1]] = tellmessage | |
else | |
localstorage[msg.match[1]] += tellmessage | |
msg.send "@" + msg.message.user.name + ": Sodesu sensei sama!" | |
return | |
robot.hear /./i, (msg) -> | |
# just send the messages if they are available... | |
if localstorage[msg.message.user.name] != undefined | |
tellmessage = localstorage[msg.message.user.name] | |
delete localstorage[msg.message.user.name] | |
msg.send tellmessage | |
return | |
## irc HACK | |
robot.on 'join', (channel, who) -> | |
console.log who |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment