mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
interact: if messenger is not set, skip starting
This commit is contained in:
parent
b80f481e7d
commit
5f4239d108
|
@ -192,6 +192,7 @@ func (it *Interact) builtin() error {
|
|||
}
|
||||
|
||||
func (it *Interact) init() error {
|
||||
|
||||
if err := it.builtin(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -235,6 +236,11 @@ func (it *Interact) registerCommands(commands map[string]*Command) error {
|
|||
}
|
||||
|
||||
func (it *Interact) Start(ctx context.Context) error {
|
||||
if it.messenger == nil {
|
||||
log.Warn("messenger is not set, skip initializing")
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := it.init(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ func init() {
|
|||
type Balance struct {
|
||||
Currency string `json:"currency"`
|
||||
Available fixedpoint.Value `json:"available"`
|
||||
Locked fixedpoint.Value `json:"locked"`
|
||||
Locked fixedpoint.Value `json:"locked,omitempty"`
|
||||
}
|
||||
|
||||
func (b Balance) Total() fixedpoint.Value {
|
||||
|
|
Loading…
Reference in New Issue
Block a user