diff --git a/bbgo/pnl.go b/bbgo/pnl.go index 673ff5b7c..7cf871c4c 100644 --- a/bbgo/pnl.go +++ b/bbgo/pnl.go @@ -8,7 +8,7 @@ import ( log "github.com/sirupsen/logrus" "github.com/slack-go/slack" - "github.com/c9s/bbgo/pkg/bbgo/slack/slackstyle" + "github.com/c9s/bbgo/pkg/bbgo/slacklog/slackstyle" "github.com/c9s/bbgo/pkg/bbgo/types" ) diff --git a/bbgo/slack.go b/bbgo/slack.go index 4f9a5c60c..e69f2f2dc 100644 --- a/bbgo/slack.go +++ b/bbgo/slack.go @@ -28,9 +28,9 @@ type SlackAttachmentCreator interface { type SlackNotifier struct { Slack *slack.Client - TradingChannel string - ErrorChannel string - InfoChannel string + TradeChannel string + ErrorChannel string + InfoChannel string } func (n *SlackNotifier) Notify(format string, args ...interface{}) { @@ -74,7 +74,7 @@ func (n *SlackNotifier) Notify(format string, args ...interface{}) { } func (n *SlackNotifier) ReportTrade(trade *types.Trade) { - _, _, err := n.Slack.PostMessageContext(context.Background(), n.TradingChannel, + _, _, err := n.Slack.PostMessageContext(context.Background(), n.TradeChannel, slack.MsgOptionText(util.Render(`:handshake: {{ .Symbol }} {{ .Side }} Trade Execution @ {{ .Price }}`, trade), true), slack.MsgOptionAttachments(trade.SlackAttachment())) @@ -86,7 +86,7 @@ func (n *SlackNotifier) ReportTrade(trade *types.Trade) { func (n *SlackNotifier) ReportPnL(report *ProfitAndLossReport) { attachment := report.SlackAttachment() - _, _, err := n.Slack.PostMessageContext(context.Background(), n.TradingChannel, + _, _, err := n.Slack.PostMessageContext(context.Background(), n.TradeChannel, slack.MsgOptionText(util.Render( `:heavy_dollar_sign: Here is your *{{ .symbol }}* PnL report collected since *{{ .startTime }}*`, map[string]interface{}{ diff --git a/bbgo/slack/logrus_look.go b/bbgo/slacklog/logrus_look.go similarity index 98% rename from bbgo/slack/logrus_look.go rename to bbgo/slacklog/logrus_look.go index 25c6efb95..8b42d4d4e 100644 --- a/bbgo/slack/logrus_look.go +++ b/bbgo/slacklog/logrus_look.go @@ -1,4 +1,4 @@ -package slack +package slacklog import ( "context" diff --git a/bbgo/slack/slackstyle/style.go.go b/bbgo/slacklog/slackstyle/style.go.go similarity index 100% rename from bbgo/slack/slackstyle/style.go.go rename to bbgo/slacklog/slackstyle/style.go.go