Skip to content

Commit

Permalink
Add help hours functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
arinehouse committed Apr 8, 2017
1 parent 5b19b04 commit ebf3edf
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions app/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,28 @@ controller.hears(['hello', 'hi', 'howdy'], ['direct_message', 'direct_mention',
});
});

controller.hears(['help hours', 'office hours', 'ta hours', 'TA hours', 'homework hours'], ['direct_message'], (bot, message) => {
const d = new Date();
let reply = '';
switch (d.getDay()) {
case 0:
reply = 'TA office hours today are from 6-9PM in Sudikoff 003!';
break;
case 1:
reply = 'TA office hours today are from 8-11PM in Sudikoff 003!\nTim has office hours from 3-5PM. He\'s either in Sudikoff 219 or 007.';
break;
case 3:
reply = 'There are all kinds of office hours today!\nFor earlybirds: 9-11AM, Sudikoff 003\nFor night owls: 8-11PM, Sudikoff 003\n';
break;
case 5:
reply = 'Tim has office hours today from 11AM-1PM. He\'s either in Sudikoff 219 or 007.';
break;
default:
reply = 'No office hours today, but you can reach out on Slack with any questions! (Use me to post anonymously in any channel if you want.)';
}
bot.reply(message, reply);
});

controller.hears(['help'], ['direct_message', 'direct_mention', 'mention'], (bot, message) => {
bot.reply(message, 'Message me with the word \'post\' and I\'ll post anonymously in #general for you...');
});
Expand Down

0 comments on commit ebf3edf

Please sign in to comment.