mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 06:53:52 +00:00
bbgo: add slack enable interaction config
This commit is contained in:
parent
e379e4c97d
commit
838efe8295
|
@ -63,9 +63,10 @@ func (m *ExchangeStrategyMount) Map() (map[string]interface{}, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
type SlackNotification struct {
|
type SlackNotification struct {
|
||||||
DefaultChannel string `json:"defaultChannel,omitempty" yaml:"defaultChannel,omitempty"`
|
DefaultChannel string `json:"defaultChannel,omitempty" yaml:"defaultChannel,omitempty"`
|
||||||
ErrorChannel string `json:"errorChannel,omitempty" yaml:"errorChannel,omitempty"`
|
ErrorChannel string `json:"errorChannel,omitempty" yaml:"errorChannel,omitempty"`
|
||||||
QueueSize int `json:"queueSize,omitempty" yaml:"queueSize,omitempty"`
|
QueueSize int `json:"queueSize,omitempty" yaml:"queueSize,omitempty"`
|
||||||
|
EnableInteraction bool `json:"enableInteraction,omitempty" yaml:"enableInteraction,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type SlackNotificationRouting struct {
|
type SlackNotificationRouting struct {
|
||||||
|
|
|
@ -871,7 +871,7 @@ func (environ *Environment) setupSlack(userConfig *Config, slackToken string, pe
|
||||||
var notifier = slacknotifier.New(client, conf.DefaultChannel, notifierOpts...)
|
var notifier = slacknotifier.New(client, conf.DefaultChannel, notifierOpts...)
|
||||||
Notification.AddNotifier(notifier)
|
Notification.AddNotifier(notifier)
|
||||||
|
|
||||||
if hasSlackAppToken {
|
if hasSlackAppToken && conf.EnableInteraction {
|
||||||
// allocate a store, so that we can save the chatID for the owner
|
// allocate a store, so that we can save the chatID for the owner
|
||||||
var messenger = interact.NewSlack(client)
|
var messenger = interact.NewSlack(client)
|
||||||
var sessions = interact.SlackSessionMap{}
|
var sessions = interact.SlackSessionMap{}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user