<commit_before>var builder = require('botbuilder');
var yelputil = require('../util/yelp');

module.exports = [
    function (session, args, next) {
        //check if asked for location more than 5 minutes ago
        //if (!session.userData.lastAskedForLocation 
        //   || ((new Date) - session.userData.lastAskedForLocation) > 300000) {
                 session.beginDialog("location");
        //} else {
        //     next();
        }
    },
    function (session){
        if (session.userData.lat & session.userData.long) {
            // prompt for search option
            builder.Prompts.choice(
                session,
                'So, what kind of place are you looking for? Just write me your preference, or choose from one of these popular ones:',
                ['Diner', 'Pub', 'Hotel Bar', 'Breakfast', 'Café', 'Brunch', 'Italian', 'Chinese', 'Japanese'],
                {
                    maxRetries: 0
                });
        }
        else
        {
            session.send('Couldn\'t get your location... Better luck next time!');
            session.replaceDialog('/');
        }
    },
    function (session, results) {
        if (results.response.entity) {
            session.dialogData.answer = results.response.entity;
        } 
        else if (session.message.text)
        {
            session.dialogData.answer = session.message.text;
        }
        if (session.dialogData.answer)
        {
            session.send('Got it! Here\'s top recommendations from Yelp close to you that are open now that have \'' + session.dialogData.answer + '\' in the categories or comments:');
            yelputil.getYelpRecommendations(session.dialogData.answer, session.userData.lat, session.userData.long)
            .then(places => {
                var cards = yelputil.getCardsFromPlaces(session, places);
                var reply = new builder.Message(session)
                    .attachmentLayout(builder.AttachmentLayout.carousel)
                    .attachments(cards);
                session.send(reply);
                session.replaceDialog('/');
            })
        }
        else
        {
            session.send('Couldn\'t understand your answer... Better luck next time!');
            session.replaceDialog('/');
        }
    }
]<commit_msg>Fixing issue<commit_after>var builder = require('botbuilder');
var yelputil = require('../util/yelp');

module.exports = [
    function (session, args, next) {
        //check if asked for location more than 5 minutes ago
        //if (!session.userData.lastAskedForLocation 
        //   || ((new Date) - session.userData.lastAskedForLocation) > 300000) {
                 session.beginDialog("location");
        //} else {
        //     next();
        //}
    },
    function (session){
        if (session.userData.lat & session.userData.long) {
            // prompt for search option
            builder.Prompts.choice(
                session,
                'So, what kind of place are you looking for? Just write me your preference, or choose from one of these popular ones:',
                ['Diner', 'Pub', 'Hotel Bar', 'Breakfast', 'Café', 'Brunch', 'Italian', 'Chinese', 'Japanese'],
                {
                    maxRetries: 0
                });
        }
        else
        {
            session.send('Couldn\'t get your location... Better luck next time!');
            session.replaceDialog('/');
        }
    },
    function (session, results) {
        if (results.response.entity) {
            session.dialogData.answer = results.response.entity;
        } 
        else if (session.message.text)
        {
            session.dialogData.answer = session.message.text;
        }
        if (session.dialogData.answer)
        {
            session.send('Got it! Here\'s top recommendations from Yelp close to you that are open now that have \'' + session.dialogData.answer + '\' in the categories or comments:');
            yelputil.getYelpRecommendations(session.dialogData.answer, session.userData.lat, session.userData.long)
            .then(places => {
                var cards = yelputil.getCardsFromPlaces(session, places);
                var reply = new builder.Message(session)
                    .attachmentLayout(builder.AttachmentLayout.carousel)
                    .attachments(cards);
                session.send(reply);
                session.replaceDialog('/');
            })
        }
        else
        {
            session.send('Couldn\'t understand your answer... Better luck next time!');
            session.replaceDialog('/');
        }
    }
]
{'fraction_non_alphanumeric': 0.11881615899762368, 'fraction_numerical': 0.0034564700799308706, 'mean_word_length': 1.7299528301886793, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4480705', 'n_tokens_mistral': 1245, 'n_tokens_neox': 1174, 'n_words': 295}