<commit_before>$LOAD_PATH << './lib'
require 'irc'

$b = binding()

irc = IRC.new( :server => 'irc.freenode.org',
                 :port => 6667,
                 :nick => 'on_scott',
                :ident => 'on_irc',
             :realname => 'on_irc Ruby IRC library',
              :options => { :use_ssl => false } )

irc.on_001 do
	irc.join '#botters,##scott'
end

irc.on_privmsg do |e|
  case e.message
  when '!ping'
    irc.msg(e.recipient, e.sender.nick + ': pong')
  when /^!echo (.*)/
    irc.msg(e.recipient, e.sender.nick + ': ' + $1)
  when /^!join (.*)/
    irc.join($1)
  when '!part'
    irc.part(e.recipient)
  when '!quit'
    if e.sender.host == 'unaffiliated/sco50000'
      abort('Told to quit by ' + e.sender.mask.to_s + ' in ' + e.recipient)
    else
      irc.msg(e.recipient, e.sender.nick + ': no u')
    end
  when /^!eval (.*)/
    if e.sender.host == 'unaffiliated/sco50000'
      begin
        irc.msg(e.recipient, eval($1, $b, 'eval', 1))
      rescue Exception => error
        irc.msg(e.recipient, error.message)
      end
    else
      irc.msg(e.recipient, 'compile error')
    end
  end
end

irc.on_all_events do |e|
	p e
end

irc.connect
<commit_msg>edited the sample bot<commit_after>$LOAD_PATH << './lib'
require 'irc'

$b = binding()

irc = IRC.new( :server => 'irc.freenode.org',
                 :port => 6667,
                 :nick => 'on_scott',
                :ident => 'on_irc',
             :realname => 'on_irc Ruby IRC library',
              :options => { :use_ssl => false } )

irc.on_001 do
	irc.join '#botters,##scott'
end

irc.on_privmsg do |e|
  case e.message
  when '!ping'
    irc.msg(e.recipient, e.sender.nick + ': pong')
  when /^!echo (.*)/
    irc.msg(e.recipient, e.sender.nick + ': ' + $1)
  when /^!join (.*)/
    irc.join($1)
  when '!part'
    irc.part(e.recipient)
  when '!quit'
    if e.sender.host == 'unaffiliated/sco50000'
      puts('Told to quit by ' + e.sender.mask.to_s + ' in ' + e.recipient)
      exit
    else
      irc.msg(e.recipient, e.sender.nick + ': no u')
    end
  when /^!eval (.*)/
    if e.sender.host == 'unaffiliated/sco50000'
      begin
        irc.msg(e.recipient, eval($1, $b, 'eval', 1))
      rescue Exception => error
        irc.msg(e.recipient, error.message)
      end
    else
      irc.msg(e.recipient, 'compile error')
    end
  end
end

irc.on_all_events do |e|
	p e
end



irc.connect

{'fraction_non_alphanumeric': 0.17166666666666666, 'fraction_numerical': 0.0175, 'mean_word_length': 2.1303780964797916, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 19, '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': '7398291', 'n_tokens_mistral': 1022, 'n_tokens_neox': 920, 'n_words': 202}