<commit_before>require 'discordrb'
require 'pstore'
require 'yaml'
require_relative 'lib/rabblebot/rabble_bot_plugin'

# This is a simple discord bot that supports plugins
class RabbleBot
  attr_accessor :token, :app_id, :bot, :brain, :plugins, :config

  # expects you to set environment variables DISCORD_TOKEN and DISCORD_APP_ID
  # I used env vars because something something elastic beanstalk. (lol)
  def initialize
    load_config
    @token = ENV.fetch('DISCORD_TOKEN', @config[:DISCORD_TOKEN])
    @app_id = ENV.fetch('DISCORD_APP_ID', @config[:DISCORD_APP_ID])
    @bot = my_bot
    begin
      lsb = File.read('/etc/lsb-release')
      @bot.encoder.use_avconv = true if lsb =~ /Ubuntu 14.04.4 LTS/
    rescue StandardError => e
      nil
    end
    @bot.info "The first few characters of the discord token are: #{@token[0, 5]}"
    @bot.info "App_id is: #{@app_id}"
  end

  # a shim for unit testing
  def my_bot
    Discordrb::Bot.new token: @token, application_id: @app_id
  end
<commit_msg>Revert "use libav if on ubuntu 14.04"<commit_after>require 'discordrb'
require 'pstore'
require 'yaml'
require_relative 'lib/rabblebot/rabble_bot_plugin'

# This is a simple discord bot that supports plugins
class RabbleBot
  attr_accessor :token, :app_id, :bot, :brain, :plugins, :config

  # expects you to set environment variables DISCORD_TOKEN and DISCORD_APP_ID
  # I used env vars because something something elastic beanstalk. (lol)
  def initialize
    load_config
    @token = ENV.fetch('DISCORD_TOKEN', @config[:DISCORD_TOKEN])
    @app_id = ENV.fetch('DISCORD_APP_ID', @config[:DISCORD_APP_ID])
    @bot = my_bot
    @bot.info "The first few characters of the discord token are: #{@token[0, 5]}"
    @bot.info "App_id is: #{@app_id}"
  end

  # a shim for unit testing
  def my_bot
    Discordrb::Bot.new token: @token, application_id: @app_id
  end

{'fraction_non_alphanumeric': 0.10492505353319058, 'fraction_numerical': 0.006959314775160599, 'mean_word_length': 4.148760330578512, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '3042413', 'n_tokens_mistral': 673, 'n_tokens_neox': 652, 'n_words': 193}