<commit_before>require 'rubygems'
require 'pp'
require 'db'

class MessageType
  MESSAGE       = :message
  DIRECTMESSAGE = :"direct-message"
  STARRED       = :starred
  UNSTARRED     = :unstarred
end

#The interface message object between Linkbot::Plugin and the plugins.
#New axiom: the plugins know nothing about the service they're using!
Message = Struct.new(:body, :user_id, :type)

class Linkbot  
  class Plugin
    @@plugins = {}
    @@message_log = []
    
    def self.handle_message(message)
      print "handle_message got called with #{message}"
      final_message = []

      Linkbot::Plugin.plugins.each {|k,v|
        if v[:handlers][message.type] && v[:handlers][message.type][:handler]<commit_msg>add user_name to message struct<commit_after>require 'rubygems'
require 'pp'
require 'db'

class MessageType
  MESSAGE       = :message
  DIRECTMESSAGE = :"direct-message"
  STARRED       = :starred
  UNSTARRED     = :unstarred
end

#The interface message object between Linkbot::Plugin and the plugins.
#New axiom: the plugins know nothing about the service they're using!
Message = Struct.new(:body, :user_id, :user_name, :type)

class Linkbot  
  class Plugin
    @@plugins = {}
    @@message_log = []
    
    def self.handle_message(message)
      print "handle_message got called with #{message}"
      final_message = []

      Linkbot::Plugin.plugins.each {|k,v|
        if v[:handlers][message.type] && v[:handlers][message.type][:handler]
{'fraction_non_alphanumeric': 0.1145975443383356, 'fraction_numerical': 0.0, 'mean_word_length': 3.642405063291139, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1724352', 'n_tokens_mistral': 467, 'n_tokens_neox': 448, 'n_words': 126}