<commit_before>/**
 * Responds to a MESSAGE event in Hangouts Chat.
 *
 * @param {Object} event the event object from Hangouts Chat
 */
function onMessage(event) {
  var name = "";

  if (event.space.type == "DM") {
    name = "You";
  } else {
    name = event.user.displayName;
  }
  var message = name + " said \"" + event.message.text + "\"";

  return { "text": message };
}

//map containing phases for DSA campaign creation.
let phase_map = new Map([
    [0, 'campaign_type'],
    [1, 'sim_name'],
    [2, 'start_date'],
    [3, 'end_date'],
    [3, 'budget'],
    [4, 'country'],
    [5, 'region'],
    [6, 'domain'],
    [7, 'target_page'],
    [8, 'ad_text'],
    [9, 'cpc']
]);

//boolean indicating if the creation phase has started.
let creating = false;

// variable to keep track of DSA creation phase.
let phase_num = 0;

//POST query string to be built by bot.
let query_string = '';

/**
 * Starts the configuration process for the DSA Campaign.
 *
 * @param {Object} event the event object from the Hangouts Chat
 */
function startConfiguration(message) {
   
}

/**
 * Validates each message based on parameters.
 *
 * @param   message       message being validated
 * @param   requiredInput values that the message must match.
 * @returns               boolean representing if message is valid. 
 */
function validateAnswer(message, requiredInput) {
  for (index = 0; index < requiredInput.length; index++) { 
    if (requiredInput[index] === message) {
      return true; 
    }
  } 
  return false;
}

/**
 * Responds to an ADDED_TO_SPACE event in Hangouts Chat.
 *<commit_msg>Modify code.js for debugging.<commit_after>//boolean indicating if the creation phase has started.
let creating = false;

// variable to keep track of DSA creation phase.
var phase_num = 0;

//POST query string to be built by bot.
let query_string = '';

/**
 * Responds to a MESSAGE event in Hangouts Chat.
 *
 * @param {Object} event the event object from Hangouts Chat
 */
function onMessage(event) {
  var name = "";
  
  if (event.space.type == "DM") {
    name = "You" + phase_num;
  } else {
    name = event.user.displayName;
  }
  var message = name + " said \"" + event.message.text + phase_num + "\"";
  phase_num++;
  
  return { "text": message };
}

//map containing phases for DSA campaign creation.
let phase_map = new Map([
    [0, 'campaign_type'],
    [1, 'sim_name'],
    [2, 'start_date'],
    [3, 'end_date'],
    [3, 'budget'],
    [4, 'country'],
    [5, 'region'],
    [6, 'domain'],
    [7, 'target_page'],
    [8, 'ad_text'],
    [9, 'cpc']
]);

/**
 * Starts the configuration process for the DSA Campaign.
 *
 * @param {Object} event the event object from the Hangouts Chat
 */
function startConfiguration(message) {
   
}

/**
 * Validates each message based on parameters.
 *
 * @param   message       message being validated
 * @param   requiredInput values that the message must match.
 * @returns               boolean representing if message is valid. 
 */
function validateAnswer(message, requiredInput) {
  for (index = 0; index < requiredInput.length; index++) { 
    if (requiredInput[index] === message) {
      return true; 
    }
  } 
  return false;
}

/**
 * Responds to an ADDED_TO_SPACE event in Hangouts Chat.
 *
{'fraction_non_alphanumeric': 0.1371586376189015, 'fraction_numerical': 0.007977907333537895, 'mean_word_length': 2.9515151515151516, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 3, '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': '4696082', 'n_tokens_mistral': 1051, 'n_tokens_neox': 1019, 'n_words': 351}