<commit_before>package main

import (
  "log"
  "os"
  "github.com/nlopes/slack"
  "github.com/inteliquent/casatunes"
)

func casa_NowPlaying(slack_api *slack.Client, slack_channel_id string) {
  CASA_ENDPOINT := os.Getenv("CASA_ENDPOINT")

  message_parameters := slack.NewPostMessageParameters()
  message_parameters.AsUser = true

  casa_api := casatunes.New(CASA_ENDPOINT)

  nowplaying, err := casa_api.NowPlaying("0")
  if err != nil {
    log.Fatal(err)
  }

  attachment := slack.Attachment{
    Title: "Now Playing",
    TitleLink: CASA_ENDPOINT,
    ThumbURL: nowplaying.CurrSong.ArtworkURI,
    Color: "#aeffa0",
    Fields: []slack.AttachmentField{
      slack.AttachmentField{
        Title: "Title",
        Value: nowplaying.CurrSong.Title,
      },
      slack.AttachmentField{
        Title: "Artist",
        Value: nowplaying.CurrSong.Artists,
        Short: true,
      },
      slack.AttachmentField{
        Title: "Album",
        Value: nowplaying.CurrSong.Album,
        Short: true,
      },
    },
  }

  message_parameters.Attachments = []slack.Attachment{attachment}
  if len(nowplaying.CurrSong.Title) > 0 {
    slack_api.PostMessage(
      slack_channel_id,
      "",
      message_parameters,
    )
  }
}<commit_msg>nowplaying Now accepts slack.MessageEvent object<commit_after>package main

import (
  "log"
  "os"
  "github.com/nlopes/slack"
  "github.com/inteliquent/casatunes"
)

func casa_NowPlaying(slack_api *slack.Client, ev *slack.MessageEvent) {
  CASA_ENDPOINT := os.Getenv("CASA_ENDPOINT")

  message_parameters := slack.NewPostMessageParameters()
  message_parameters.AsUser = true

  casa_api := casatunes.New(CASA_ENDPOINT)

  nowplaying, err := casa_api.NowPlaying("0")
  if err != nil {
    log.Fatal(err)
  }

  attachment := slack.Attachment{
    Title: "Now Playing",
    TitleLink: CASA_ENDPOINT,
    ThumbURL: nowplaying.CurrSong.ArtworkURI,
    Color: "#aeffa0",
    Fields: []slack.AttachmentField{
      {
        Title: "Title",
        Value: nowplaying.CurrSong.Title,
      },
      {
        Title: "Artist",
        Value: nowplaying.CurrSong.Artists,
        Short: true,
      },
      {
        Title: "Album",
        Value: nowplaying.CurrSong.Album,
        Short: true,
      },
    },
  }

  message_parameters.Attachments = []slack.Attachment{attachment}
  if len(nowplaying.CurrSong.Title) > 0 {
    slack_api.PostMessage(
      ev.Channel,
      "",
      message_parameters,
    )
  }
}
{'fraction_non_alphanumeric': 0.12149532710280374, 'fraction_numerical': 0.002438033319788704, 'mean_word_length': 2.8894154818325433, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4388336', 'n_tokens_mistral': 901, 'n_tokens_neox': 849, 'n_words': 135}