Skip to content

Commit

Permalink
bbgo: add slack enable interaction config
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Nov 15, 2024
1 parent e379e4c commit 838efe8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions pkg/bbgo/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@ func (m *ExchangeStrategyMount) Map() (map[string]interface{}, error) {
}

type SlackNotification struct {
DefaultChannel string `json:"defaultChannel,omitempty" yaml:"defaultChannel,omitempty"`
ErrorChannel string `json:"errorChannel,omitempty" yaml:"errorChannel,omitempty"`
QueueSize int `json:"queueSize,omitempty" yaml:"queueSize,omitempty"`
DefaultChannel string `json:"defaultChannel,omitempty" yaml:"defaultChannel,omitempty"`
ErrorChannel string `json:"errorChannel,omitempty" yaml:"errorChannel,omitempty"`
QueueSize int `json:"queueSize,omitempty" yaml:"queueSize,omitempty"`
EnableInteraction bool `json:"enableInteraction,omitempty" yaml:"enableInteraction,omitempty"`
}

type SlackNotificationRouting struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/bbgo/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@ func (environ *Environment) setupSlack(userConfig *Config, slackToken string, pe
var notifier = slacknotifier.New(client, conf.DefaultChannel, notifierOpts...)
Notification.AddNotifier(notifier)

if hasSlackAppToken {
if hasSlackAppToken && conf.EnableInteraction {
// allocate a store, so that we can save the chatID for the owner
var messenger = interact.NewSlack(client)
var sessions = interact.SlackSessionMap{}
Expand Down

0 comments on commit 838efe8

Please sign in to comment.