mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-15 03:23:52 +00:00
deposit2transfer: pass customized channel
This commit is contained in:
parent
9e2cb4bd7f
commit
f37fab08a0
|
@ -42,6 +42,7 @@ func init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
type SlackAlert struct {
|
type SlackAlert struct {
|
||||||
|
Channel string `json:"channel"`
|
||||||
Mentions []string `json:"mentions"`
|
Mentions []string `json:"mentions"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -213,6 +214,7 @@ func (s *Strategy) checkDeposits(ctx context.Context) {
|
||||||
|
|
||||||
if s.SlackAlert != nil {
|
if s.SlackAlert != nil {
|
||||||
bbgo.PostLiveNote(&d,
|
bbgo.PostLiveNote(&d,
|
||||||
|
livenote.Channel(s.SlackAlert.Channel),
|
||||||
livenote.Comment(fmt.Sprintf("Transferring deposit asset %s %s into the margin account", amount.String(), d.Asset)),
|
livenote.Comment(fmt.Sprintf("Transferring deposit asset %s %s into the margin account", amount.String(), d.Asset)),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -225,6 +227,7 @@ func (s *Strategy) checkDeposits(ctx context.Context) {
|
||||||
|
|
||||||
if s.SlackAlert != nil {
|
if s.SlackAlert != nil {
|
||||||
bbgo.PostLiveNote(&d,
|
bbgo.PostLiveNote(&d,
|
||||||
|
livenote.Channel(s.SlackAlert.Channel),
|
||||||
livenote.Comment(fmt.Sprintf("Margin account transfer error: %+v", err2)),
|
livenote.Comment(fmt.Sprintf("Margin account transfer error: %+v", err2)),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -238,6 +241,7 @@ func (s *Strategy) addWatchingDeposit(deposit types.Deposit) {
|
||||||
|
|
||||||
if s.SlackAlert != nil {
|
if s.SlackAlert != nil {
|
||||||
bbgo.PostLiveNote(&deposit,
|
bbgo.PostLiveNote(&deposit,
|
||||||
|
livenote.Channel(s.SlackAlert.Channel),
|
||||||
livenote.CompareObject(true),
|
livenote.CompareObject(true),
|
||||||
livenote.OneTimeMention(s.SlackAlert.Mentions...),
|
livenote.OneTimeMention(s.SlackAlert.Mentions...),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user