func sendBuildStartedMessage(build *gojenkins.Build, slackClient client.SlackClient, ref msg.Ref) string {
	estimatedDuration := time.Duration(build.Raw.EstimatedDuration) * time.Millisecond
	text := fmt.Sprintf(
		"Job %s started (#%d - estimated: %s)",
		build.Job.GetName(),
		build.GetBuildNumber(),
		util.FormatDuration(estimatedDuration),
	)
	msgTimestamp := slackClient.SendMessage(
		ref,
		"",
		GetAttachment(build, text),
	)
	return msgTimestamp
}
send main response (with parameters)
package jenkins
import (
	"context"
	"fmt"
	"sync"
	"time"
	"github.com/bndr/gojenkins"
	"github.com/innogames/slack-bot/v2/bot/config"
	"github.com/innogames/slack-bot/v2/bot/msg"
	"github.com/innogames/slack-bot/v2/bot/util"
	"github.com/innogames/slack-bot/v2/client"
	"github.com/innogames/slack-bot/v2/command/queue"
	"github.com/pkg/errors"
	log "github.com/sirupsen/logrus"
	"github.com/slack-go/slack"
)
var mu sync.Mutex
func TriggerJenkinsJob(cfg config.JobConfig, jobName string, jobParams Parameters, slackClient client.SlackClient, jenkins Client, message msg.Message) error {
	log.Infof("%s started started job %s: %s", message.GetUser(), jobName, jobParams)
	_, jobParams[slackUserParameter] = client.GetUserIDAndName(message.GetUser())
	processHooks(cfg.OnStart, message, jobParams)
	slackClient.AddReaction(iconPending, message)
	ctx := context.Background()
	build, err := startJob(ctx, jenkins, jobName, jobParams)
	if err != nil {
		return errors.Wrapf(err, "Job *%s* could not start build with parameters: %s", jobName, jobParams)
	}
	slackClient.RemoveReaction(iconPending, message)
	msgTimestamp := sendBuildStartedMessage(build, slackClient, message)
	runningCommand := queue.AddRunningCommand(
		message,
		fmt.Sprintf("inform job %s #%d", jobName, build.GetBuildNumber()),
	)
	go func() {
		<-WatchBuild(build)
		runningCommand.Done()
		attachment := GetAttachment(build, fmt.Sprintf(
			"Job %s #%d finished!",
			build.Job.GetName(),
			build.GetBuildNumber(),
		))
		slackClient.SendMessage(
			message,
			"",
			slack.MsgOptionUpdate(msgTimestamp),
			attachment,
		)
		text := getFinishBuildText(build, message.User, jobName)
		if build.Raw.Result == gojenkins.STATUS_SUCCESS {
			slackClient.SendMessage(message, text)
			processHooks(cfg.OnSuccess, message, jobParams)
		} else {
			slackClient.SendMessage(
				message,
				text,
				slack.MsgOptionTS(msgTimestamp),
			)
			processHooks(cfg.OnFailure, message, jobParams)
		}
	}()
	return nil
}