From f5f96b585a6cba07389aed1f899a6a17a887bdf9 Mon Sep 17 00:00:00 2001 From: c9s Date: Fri, 15 Oct 2021 16:10:39 +0800 Subject: [PATCH] apply broadcast option from config file --- pkg/bbgo/environment.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/bbgo/environment.go b/pkg/bbgo/environment.go index 25e9b6ebe..e97b7ce09 100644 --- a/pkg/bbgo/environment.go +++ b/pkg/bbgo/environment.go @@ -605,7 +605,13 @@ func (environ *Environment) ConfigureNotificationSystem(userConfig *Config) erro go interaction.Start(session) - var notifier = telegramnotifier.New(interaction) + var opts []telegramnotifier.Option + + if userConfig.Notifications != nil && userConfig.Notifications.Telegram != nil { + opts = append(opts, telegramnotifier.UseBroadcast()) + } + + var notifier = telegramnotifier.New(interaction, opts...) environ.Notifiability.AddNotifier(notifier) }