<commit_before>defmodule EspiDni.SlackRtm do
  use Slack

  @token Application.get_env(:espi_dni, __MODULE__)[:slack_token]

  def start_link, do: start_link(@token)

  def handle_connect(slack) do
    IO.puts "Connected as #{slack.me.name}"
  end

  def handle_message(message = %{type: "message"}, slack) do
    if message.user != slack.me.id do
      IO.inspect(message)
      send_message("I got a message!", message.channel, slack)
    end
  end

  def handle_message(message = %{type: "message"}, slack) do
    # send_message("I got a message!", message.channel, slack)
  end

  def handle_message(message, _slack) do
    # IO.inspect(message)
  end

  def handle_info({:message, text, channel}, slack) do
    IO.puts "Sending your message, captain!"

    send_message(text, channel, slack)

    {:ok}
  end
  def handle_info(_, _), do: :ok

end
<commit_msg>Log slack activity instead of printing/sending mesages<commit_after>defmodule EspiDni.SlackRtm do
  use Slack
  require Logger

  @token Application.get_env(:espi_dni, __MODULE__)[:slack_token]

  def start_link, do: start_link(@token)

  def handle_connect(slack) do
    Logger.info "Connected as #{slack.me.name}"
  end

  def handle_message(message = %{type: "message"}, slack) do
    if message.user != slack.me.id do
      Logger.info "Message received: #{slack.me.name}"
    end
  end

  def handle_message(message, _slack) do
    Logger.info "Received slack activity: #{message}"
  end

  def handle_info({:message, text, channel}, slack) do
    Logger.info "Sending your message: #{text}"
    send_message(text, channel, slack)
    {:ok}
  end
  def handle_info(_, _), do: :ok

end

{'fraction_non_alphanumeric': 0.11910519951632406, 'fraction_numerical': 0.0, 'mean_word_length': 3.8676470588235294, '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': '1327895', 'n_tokens_mistral': 594, 'n_tokens_neox': 564, 'n_words': 154}