mirror of
https://github.com/nikoksr/notify.git
synced 2024-11-28 08:39:13 +02:00
Requested Changes
This commit is contained in:
parent
742d127319
commit
b07e71dade
@ -15,8 +15,7 @@ type Notify struct {
|
||||
// ErrSendNotification signals that the notifier failed to send a notification.
|
||||
var ErrSendNotification = errors.New("send notification")
|
||||
|
||||
// New returns a new instance of Notify. Defaulting to being not disabled and using the pseudo notification
|
||||
// service under the hood.
|
||||
// New returns a new instance of Notify. Defaulting to being not disabled
|
||||
func New() *Notify {
|
||||
notifier := &Notify{
|
||||
Disabled: defaultDisabled,
|
||||
|
@ -36,7 +36,8 @@ func New(apiToken string) (*Telegram, error) {
|
||||
// a given message to all those chats.
|
||||
func (t *Telegram) AddReceivers(chatIDs ...string) {
|
||||
for _, v := range chatIDs {
|
||||
if chatID, err := strconv.ParseInt(v, 10, 64); err != nil {
|
||||
chatID, err := strconv.ParseInt(v, 10, 64)
|
||||
if err != nil {
|
||||
t.chatIDs = append(t.chatIDs, chatID)
|
||||
}
|
||||
}
|
||||
|
3
use.go
3
use.go
@ -1,7 +1,6 @@
|
||||
package notify
|
||||
|
||||
// useService adds a given service to the notifiers services list. If the list still contains
|
||||
// a pseudo service we remove it before adding the 'real' service.
|
||||
// useService adds a given service to the notifiers services list.
|
||||
func (n *Notify) useService(service Notifier) {
|
||||
if service == nil {
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user