<commit_before>Robot   = require('hubot').robot()
Adapter = require('hubot').adapter()

Irc     = require 'irc'

class IrcBot extends Adapter
  send: (user, strings...) ->
    for str in strings
      if not str?
        continue
      if user.room
        console.log "#{user.room} #{str}"
        @bot.say(user.room, str)
      else
        console.log "#{user.name} #{str}"
        @bot.say(user.name, str)

  reply: (user, strings...) ->
    for str in strings
      @send user, "#{user.name}: #{str}"

  join: (channel) ->
    self = @
    @bot.join channel, () ->
      console.log('joined %s', channel)

  part: (channel) ->
    @bot.part channel, () ->
      console.log('left %s', channel)

  run: -><commit_msg>Send messages to rooms<commit_after>Robot   = require('hubot').robot()
Adapter = require('hubot').adapter()

Irc     = require 'irc'

class IrcBot extends Adapter
  send: (user, strings...) ->
    for str in strings
      if not str?
        continue
      if user.room
        console.log "#{user.room} #{str}"
        @bot.say(user.room, str)
      else if user.name
        console.log "#{user.name} #{str}"
        @bot.say(user.name, str)
      else
        console.log "#{user} #{str}"
        @bot.say(user, str)

  reply: (user, strings...) ->
    for str in strings
      @send user, "#{user.name}: #{str}"

  join: (channel) ->
    self = @
    @bot.join channel, () ->
      console.log('joined %s', channel)

  part: (channel) ->
    @bot.part channel, () ->
      console.log('left %s', channel)

  run: ->
{'fraction_non_alphanumeric': 0.17727272727272728, 'fraction_numerical': 0.0, 'mean_word_length': 2.2037422037422036, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, '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': '1494012', 'n_tokens_mistral': 522, 'n_tokens_neox': 511, 'n_words': 135}