fix title and layout

This commit is contained in:
c9s 2020-08-07 00:11:29 +08:00
parent 080cfe25d9
commit 6b478b4e87
2 changed files with 4 additions and 4 deletions

View File

@ -157,7 +157,7 @@ func (k KLine) Color() string {
func (k KLine) SlackAttachment() slack.Attachment { func (k KLine) SlackAttachment() slack.Attachment {
return slack.Attachment{ return slack.Attachment{
Text: fmt.Sprintf("KLine *%s* %s", k.Symbol, k.Interval), Text: fmt.Sprintf("*%s* KLine %s", k.Symbol, k.Interval),
Color: k.Color(), Color: k.Color(),
Fields: []slack.AttachmentField{ Fields: []slack.AttachmentField{
{Title: "Open", Value: k.Open, Short: true}, {Title: "Open", Value: k.Open, Short: true},
@ -358,7 +358,7 @@ func (k KLineWindow) SlackAttachment() slack.Attachment {
} }
return slack.Attachment{ return slack.Attachment{
Text: fmt.Sprintf("KLine *%s* %s x %d", first.Symbol, first.Interval, windowSize), Text: fmt.Sprintf("*%s* KLineWindow %s x %d", first.Symbol, first.Interval, windowSize),
Color: k.Color(), Color: k.Color(),
Fields: []slack.AttachmentField{ Fields: []slack.AttachmentField{
{Title: "Open", Value: util.FormatFloat(k.GetOpen(), 2), Short: true}, {Title: "Open", Value: util.FormatFloat(k.GetOpen(), 2), Short: true},

View File

@ -38,13 +38,13 @@ func (trade Trade) SlackAttachment() slack.Attachment {
market, ok := FindMarket(trade.Symbol) market, ok := FindMarket(trade.Symbol)
if !ok { if !ok {
return slack.Attachment{ return slack.Attachment{
Title: fmt.Sprintf("*%s* %s Trade", trade.Symbol, trade.Side), Text: fmt.Sprintf("*%s* Trade %s", trade.Symbol, trade.Side),
Color: color, Color: color,
} }
} }
return slack.Attachment{ return slack.Attachment{
Title: fmt.Sprintf("*%s* %s Trade", trade.Symbol, trade.Side), Text: fmt.Sprintf("*%s* Trade %s", trade.Symbol, trade.Side),
Color: color, Color: color,
// Pretext: "", // Pretext: "",
// Text: "", // Text: "",