mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 00:35:15 +00:00
add footer icon for exchange name
This commit is contained in:
parent
919838f24d
commit
439685141f
|
@ -155,6 +155,17 @@ func (trade Trade) SlackAttachment() slack.Attachment {
|
|||
|
||||
liquidity := trade.Liquidity()
|
||||
text := util.Render(slackTradeTextTemplate, trade)
|
||||
|
||||
footerIcon := ""
|
||||
switch trade.Exchange {
|
||||
case ExchangeBinance:
|
||||
footerIcon = "https://bin.bnbstatic.com/static/images/common/favicon.ico"
|
||||
case ExchangeMax:
|
||||
footerIcon = "https://max.maicoin.com/favicon-16x16.png"
|
||||
case ExchangeFTX:
|
||||
footerIcon = "https://ftx.com/favicon.ico?v=2"
|
||||
}
|
||||
|
||||
return slack.Attachment{
|
||||
Text: text,
|
||||
// Title: ...
|
||||
|
@ -170,6 +181,7 @@ func (trade Trade) SlackAttachment() slack.Attachment {
|
|||
{Title: "Liquidity", Value: liquidity, Short: true},
|
||||
{Title: "Order ID", Value: strconv.FormatUint(trade.OrderID, 10), Short: true},
|
||||
},
|
||||
FooterIcon: footerIcon,
|
||||
Footer: util.Render("trade time {{ . }}", trade.Time.Time().Format(time.StampMilli)),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user