<commit_before>package promplot

import (
	"fmt"

	"github.com/nlopes/slack"
)

// Slack posts a file to a Slack channel.
func Slack(token, channel, file, name, title string) error {
	api := slack.New(token)

	_, _, err := api.PostMessage(channel, "New Plot:", slack.PostMessageParameters{
		Username:  "Promplot",
		IconEmoji: ":chart_with_upwards_trend:",
		Attachments: []slack.Attachment{{
			Title: title,
		}},
	})
	if err != nil {
		return fmt.Errorf("can not post message: %v", err)
	}

	_, err = api.UploadFile(slack.FileUploadParameters{
		Title:    title,
		Filetype: "image/" + ImgExt,
		Filename: name + ImgExt,
		File:     file,
		Channels: []string{channel},
	})
	if err != nil {
		return fmt.Errorf("can not upload file: %v", err)
	}

	return nil
}<commit_msg>changing slack msg to get more helpful notifications<commit_after>package promplot

import (
	"fmt"

	"github.com/nlopes/slack"
)

// Slack posts a file to a Slack channel.
func Slack(token, channel, file, name, title string) error {
	api := slack.New(token)

	_, _, err := api.PostMessage(channel, "Promplot: "+title, slack.PostMessageParameters{
		Username:  "Promplot",
		IconEmoji: ":chart_with_upwards_trend:",
	})
	if err != nil {
		return fmt.Errorf("can not post message: %v", err)
	}

	_, err = api.UploadFile(slack.FileUploadParameters{
		Title:    title,
		Filetype: "image/" + ImgExt,
		Filename: name + ImgExt,
		File:     file,
		Channels: []string{channel},
	})
	if err != nil {
		return fmt.Errorf("can not upload file: %v", err)
	}

	return nil
}
{'fraction_non_alphanumeric': 0.142949967511371, 'fraction_numerical': 0.0, 'mean_word_length': 3.9201277955271565, 'pattern_counts': {'":': 2, '<': 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': '870421', 'n_tokens_mistral': 580, 'n_tokens_neox': 545, 'n_words': 147}