render trade time

This commit is contained in:
c9s 2021-05-17 00:53:19 +08:00
parent 45e930a086
commit 61d95a4c34

View File

@ -4,6 +4,7 @@ import (
"database/sql" "database/sql"
"fmt" "fmt"
"sync" "sync"
"time"
"github.com/slack-go/slack" "github.com/slack-go/slack"
@ -102,10 +103,10 @@ func (trade Trade) SlackAttachment() slack.Attachment {
} }
liquidity := trade.Liquidity() liquidity := trade.Liquidity()
title := util.Render(slackTradeTextTemplate, trade) text := util.Render(slackTradeTextTemplate, trade)
return slack.Attachment{ return slack.Attachment{
Title: title, Text: text,
// Text: text, // Title: ...
// Pretext: pretext, // Pretext: pretext,
Color: color, Color: color,
Fields: []slack.AttachmentField{ Fields: []slack.AttachmentField{
@ -117,8 +118,7 @@ func (trade Trade) SlackAttachment() slack.Attachment {
{Title: "FeeCurrency", Value: trade.FeeCurrency, Short: true}, {Title: "FeeCurrency", Value: trade.FeeCurrency, Short: true},
{Title: "Liquidity", Value: liquidity, Short: true}, {Title: "Liquidity", Value: liquidity, Short: true},
}, },
// Footer: tradingCtx.TradeStartTime.Format(time.RFC822), Footer: util.Render("trade time {{ . }}", trade.Time.Time().Format(time.RFC822)),
// FooterIcon: "",
} }
} }