Skip to content

Commit

Permalink
Remove the Meetup Info response
Browse files Browse the repository at this point in the history
Fixes #86

I did this all through GitHub GUI so please check carefully :p
  • Loading branch information
AverageMarcus committed Mar 13, 2018
1 parent e12b052 commit de83d17
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions scripts/meetup.js
Expand Up @@ -51,24 +51,9 @@ module.exports = function (robot) {
});
}

function meetupInfo(msg) {
var eventId = msg.match[1];
var meetupInfoUrl = createMeetupInfoUrl(eventId, API_KEY);
robot.http(meetupInfoUrl).get()(function (err, res, body) {
if (err) console.log(err);
var results = JSON.parse(body).results;
if (results && results.length > 0) {
msg.send(meetupInfoResponse(results[0]));
} else {
msg.send('That event doesn\'t exist.');
}
});
}

robot.hear(/^(?:when|what)(?:.?s| is) the next (.*)(?:meet up|meetup|event|talk|party|hack|shindig|gathering|meeting|happening)?/i, processMessage);
robot.hear(/^(?:are|is) there (?:any|a) (.*)(?:meet up|meetup|event|talk|party|hack|shindig|gathering|meeting|happening)?/i, processMessage);
robot.respond(/(?:when|what)(?:.?s| is) the next (.*)(?:meet up|meetup|event|talk|party|hack|shindig|gathering|meeting|happening)?/i, processMessage);
robot.hear(/meetup\.com\/[^\/]+\/events\/(\d+)/i, meetupInfo);
}


Expand All @@ -89,10 +74,6 @@ function isWas(event) {
return event.status==="past" ? 'was' : 'is';
}

function meetupInfoResponse(event) {
return `That event ${isWas(event)} ${eventDetails(event)}`;
}

function eventDetails(event, outOfOxford) {
var eventTime = moment(event.time).tz('Europe/London').format('dddd Do MMMM YYYY [at] h:mma');
output = `"${event.name}" on ${eventTime}. `;
Expand Down

0 comments on commit de83d17

Please sign in to comment.