<commit_before># Description:
#   Encourages users to take an IRC bouncer.
#
# Dependencies:
#   None
#
# Configuration:
#   None
#
# Commands:
#   hubot [user] does not seem to have a bouncer - Saves [user] in memory
#   hubot who does not have a bouncer? - List users without a bouncer from memory
#   hubot [user] (now)? has a bouncer - Remove [user] from memory
#
# Author:
#   <NAME> <<EMAIL>>

String::startsWith ?= (s) -> @slice(0, s.length) == s

module.exports = (robot) ->
  robot.enter (res) ->
    for user in robot.brain.users_without_bouncer
      if res.message.user.name.startsWith user
        res.reply "Prend un bouncer s'il te plait."

  robot.respond /([^\s]+) does not seem to have a bouncer/, (res) ->
    if res.message.user.name is 'pchaigno'
      users = robot.brain.users_without_bouncer or []
      users.push(res.match[1])
      robot.brain.users_without_bouncer = users
      res.reply "I'll keep that in mind"
    else
      res.send 'pchaigno?'

  robot.respond /who does not have a bouncer\?/, (res) ->
    users = robot.brain.users_without_bouncer or []
    users_text = users.join(', ')
    res.reply users_text

  robot.respond /([^\s]+) (now )?has a bouncer/, (res) ->
    if res.message.user.name is 'pchaigno'
      users = robot.brain.users_without_bouncer or []
      robot.brain.users_without_bouncer = users.filter (user) -> user isnt res.match[1]
      res.reply "Glad to hear that!"
    else
      res.send 'pchaigno?'<commit_msg>Cure Patricia's alzheimer<commit_after># Description:
#   Encourages users to take an IRC bouncer.
#
# Dependencies:
#   None
#
# Configuration:
#   None
#
# Commands:
#   hubot [user] does not have a bouncer - Saves [user] in memory
#   hubot who does not have a bouncer? - List users without a bouncer from memory
#   hubot [user] (now)? has a bouncer - Remove [user] from memory
#
# Author:
#   <NAME> <<EMAIL>>

String::startsWith ?= (s) -> @slice(0, s.length) == s

module.exports = (robot) ->
  robot.enter (res) ->
    for user in robot.brain.get('users_without_bouncer')
      if res.message.user.name.startsWith user
        res.reply "Prend un bouncer s'il te plait."

  robot.respond /([^\s]+) does not have a bouncer$/, (res) ->
    if res.message.user.name is 'pchaigno'
      users = robot.brain.get('users_without_bouncer') or []
      users.push(res.match[1])
      robot.brain.set 'users_without_bouncer', users
      res.reply "I'll keep that in mind"
    else
      res.send 'pchaigno?'

  robot.respond /who does not have a bouncer\?/, (res) ->
    users = robot.brain.get('users_without_bouncer') or []
    users_text = users.join(', ')
    res.reply users_text

  robot.respond /([^\s]+) (now )?has a bouncer/, (res) ->
    if res.message.user.name is 'pchaigno'
      users = robot.brain.get('users_without_bouncer') or []
      users_without_bouncer = users.filter (user) -> user isnt res.match[1]
      robot.brain.set 'users_without_bouncer', users_without_bouncer
      res.reply "Glad to hear that!"
    else
      res.send 'pchaigno?'
{'fraction_non_alphanumeric': 0.13589996709443897, 'fraction_numerical': 0.0019743336623889436, 'mean_word_length': 3.0318302387267906, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 23, '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': '886474', 'n_tokens_mistral': 1104, 'n_tokens_neox': 1091, 'n_words': 299}