mirror of
https://github.com/c9s/bbgo.git
synced 2024-09-20 08:11:08 +00:00
telegramnotifier: add SetOwner method
This commit is contained in:
parent
dd93ee4fd3
commit
97ca304bec
|
@ -115,6 +115,11 @@ func (n *Notifier) AddSubscriber(m *telebot.Message) {
|
|||
n.Chats[m.Chat.ID] = m.Time()
|
||||
}
|
||||
|
||||
func (n *Notifier) SetOwner(owner *telebot.User, chat *telebot.Chat) {
|
||||
n.Owner = owner
|
||||
n.OwnerChat = chat
|
||||
}
|
||||
|
||||
func (n *Notifier) SendToOwner(message string) {
|
||||
if _, err := n.Bot.Send(n.OwnerChat, message); err != nil {
|
||||
log.WithError(err).Error("telegram send error")
|
||||
|
|
Loading…
Reference in New Issue
Block a user