mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 01:01:56 +00:00
telegramnotifier: add broadcast option
This commit is contained in:
parent
2b0793ee49
commit
6c46c2cad1
|
@ -8,13 +8,20 @@ import (
|
|||
|
||||
type Notifier struct {
|
||||
interaction *Interaction
|
||||
broadcast bool
|
||||
}
|
||||
|
||||
type NotifyOption func(notifier *Notifier)
|
||||
type Option func(notifier *Notifier)
|
||||
|
||||
func UseBroadcast() Option {
|
||||
return func(notifier *Notifier) {
|
||||
notifier.broadcast = true
|
||||
}
|
||||
}
|
||||
|
||||
// New
|
||||
// TODO: register interaction with channel, so that we can route message to the specific telegram bot
|
||||
func New(interaction *Interaction, options ...NotifyOption) *Notifier {
|
||||
func New(interaction *Interaction, options ...Option) *Notifier {
|
||||
notifier := &Notifier{
|
||||
interaction: interaction,
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user