<commit_before># Description:
#   ENCOURAGE SHOUTING. LOUD TEXT IS FOREVER.
#   LOUD WILL CAUSE YOUR HUBOT TO STORE ALL-CAPS MESSAGES FROM THE CHANNEL,
#   AND SPIT THEM BACK AT RANDOM IN RESPONSE.
#
# Dependencies:
#   None
#
# Configuration:
#   None
#
# Commands:
#   loud delete [TEXT] - Delete the loud with the matching text.
#   loud nuke          - Delete the entire loud database. (available in debug mode only!)
#   loud all           - Print every single loud in the database. (available in debug mode only!)
#
# Author:
#   annabunches

module.exports = (robot) ->
  robot.hear /^([A-Z"][A-Z0-9 .,'"()\?!&%$#@+-]+)$/, (res) ->
    # Pick a loud from the stored list and say it. Skip if there are no louds.
    old_loud = res.random(robot.brain.get('louds'))
    if old_loud?
      res.send old_loud

    # Save new loud in the list, but only if it is unique
    new_loud = res.match[1].trim()
    if new_loud not in robot.brain.get('louds')
      robot.brain.get('louds').push(new_loud)

  robot.respond /loud (\w+)\s*(.*)?$/i, (res) ->
    action = res.match[1].trim()
    data = res.match[2]?.trim()

    switch action 
      when 'delete'
        index = robot.brain.get('louds').indexOf(data)
        if index != -1
          robot.brain.get('louds').splice(index, 1)
          res.send "Loud deleted."
        else
          res.send "Couldn't find that loud."
    
      when 'nuke'
        if process.env.DEBUG != 'true'
          res.send "Nukes are only available in debug mode."
          return

        robot.brain.set('louds', [])
        res.send "All louds deleted."<commit_msg>Percent sign might need to be escaped.<commit_after># Description:
#   ENCOURAGE SHOUTING. LOUD TEXT IS FOREVER.
#   LOUD WILL CAUSE YOUR HUBOT TO STORE ALL-CAPS MESSAGES FROM THE CHANNEL,
#   AND SPIT THEM BACK AT RANDOM IN RESPONSE.
#
# Dependencies:
#   None
#
# Configuration:
#   None
#
# Commands:
#   loud delete [TEXT] - Delete the loud with the matching text.
#   loud nuke          - Delete the entire loud database. (available in debug mode only!)
#   loud all           - Print every single loud in the database. (available in debug mode only!)
#
# Author:
#   annabunches

module.exports = (robot) ->
  robot.hear /^([A-Z"][A-Z0-9 .,'"()\?!&\%$#@+-]+)$/, (res) ->
    # Pick a loud from the stored list and say it. Skip if there are no louds.
    old_loud = res.random(robot.brain.get('louds'))
    if old_loud?
      res.send old_loud

    # Save new loud in the list, but only if it is unique
    new_loud = res.match[1].trim()
    if new_loud not in robot.brain.get('louds')
      robot.brain.get('louds').push(new_loud)

  robot.respond /loud (\w+)\s*(.*)?$/i, (res) ->
    action = res.match[1].trim()
    data = res.match[2]?.trim()

    switch action 
      when 'delete'
        index = robot.brain.get('louds').indexOf(data)
        if index != -1
          robot.brain.get('louds').splice(index, 1)
          res.send "Loud deleted."
        else
          res.send "Couldn't find that loud."
    
      when 'nuke'
        if process.env.DEBUG != 'true'
          res.send "Nukes are only available in debug mode."
          return

        robot.brain.set('louds', [])
        res.send "All louds deleted."
{'fraction_non_alphanumeric': 0.13720642768850433, 'fraction_numerical': 0.004326328800988875, 'mean_word_length': 2.3824451410658307, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '4968727', 'n_tokens_mistral': 1147, 'n_tokens_neox': 1108, 'n_words': 335}