Created
November 16, 2012 15:23
-
-
Save KishCom/4088155 to your computer and use it in GitHub Desktop.
Coffee time?
This file contains hidden or 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
# Description: | |
# Answer the question: is it coffee time? | |
# | |
# Commands: | |
# listens for: is it coffee time? ... and stuff... read the regex | |
# | |
# Fuck I hate CoffeeScript | |
module.exports = (robot) -> | |
robot.hear /(is it )?coffee( time)?\?/i, (msg) -> | |
now = new Date() | |
response = undefined | |
max = undefined | |
index = "" | |
if now.getHours() is 14 | |
fuckYesCoffeeTime = ["Yes. It's time to get caffeinated!", "Yes. The time for coffee is nigh.", "HARK! The time to drink scalding water filtered through the roasted seeds from the Coffea genus of flowering plants HAS COME.", "Yes. Go drink coffee.", "Yes. Drop what you're doing and go consume liquids filled with caffeine.", "Yup! Time for delicious 1,3,7-trimethyl-1H-purine-2,6(3H,7H)-dione 3,7-dihydro-1,3,7-trimethyl-1H-purine-2,6-dione!!", "Yes. Coffee, the finest organic suspension ever devised. ( http://en.memory-alpha.org/wiki/Coffee ) ", "Yes. Programmers are devices for turning coffee into software.", "Yes. We need coffee and croolers stat.", "Yes. Andrew is clearly almost asleep.", "Yup! COFFEE TIME ^_^"] | |
max = fuckYesCoffeeTime.length - 1 | |
response = fuckYesCoffeeTime[Math.floor(Math.random() * (max - 0 + 1))] | |
else | |
timeTill = undefined | |
if now.getHours() > 14 | |
if now.getHours() >= 16 | |
timeTill = "It's a little late for coffee..." | |
else | |
timeTill = "Just missed it... go if you really need to." | |
else | |
timeTill = "Coffee time in t-minus " + ( (13 - now.getHours())*60 + (60 - now.getMinutes()) ) + " minutes." | |
awFuckNotCoffeeTime = ["Coffee? No thanks, one more cup and *I'll* jump to warp.", "No coffee now. Make due with what little energy you have left.", "Nope. Not coffee time yet.", "No. Slow your roll.", "No, it's not time for coffee.", "Haven't you had enough coffee?", "I can't let you do that Dave... err... not coffee time yet.", "Not yet. Be patient.", "Now is not the time for coffee."] | |
max = awFuckNotCoffeeTime.length - 1 | |
response = awFuckNotCoffeeTime[Math.floor(Math.random() * (max - 0 + 1))] + " " + timeTill |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment