From 30c14a6828baf4b6b721a3eb475d8558a48e61be Mon Sep 17 00:00:00 2001 From: TonyQ Date: Sat, 4 Dec 2021 02:37:21 +0000 Subject: [PATCH] fix #261 provide default config for notification setting --- pkg/bbgo/environment.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/bbgo/environment.go b/pkg/bbgo/environment.go index 16ff39d66..80e5b7087 100644 --- a/pkg/bbgo/environment.go +++ b/pkg/bbgo/environment.go @@ -616,6 +616,15 @@ func (environ *Environment) ConfigureNotificationSystem(userConfig *Config) erro environ.Notifiability.AddNotifier(notifier) } + if userConfig.Notifications == nil { + userConfig.Notifications = &NotificationConfig{ + Routing : &SlackNotificationRouting{ + Trade: "$session", + Order: "$session", + }, + } + } + if userConfig.Notifications != nil { if err := environ.ConfigureNotificationRouting(userConfig.Notifications); err != nil { return err