bbgo_origin/pkg/bbgo/livenote.go

22 lines
531 B
Go
Raw Normal View History

package bbgo
import (
"github.com/sirupsen/logrus"
"github.com/c9s/bbgo/pkg/livenote"
)
// PostLiveNote posts a live note to slack or other services
// The MessageID will be set after the message is posted if it's not set.
func PostLiveNote(obj livenote.Object) {
for _, poster := range Notification.liveNotePosters {
if err := poster.PostLiveNote(obj); err != nil {
logrus.WithError(err).Errorf("unable to post live note: %+v", obj)
}
}
}
type LiveNotePoster interface {
PostLiveNote(note livenote.Object) error
}