1
0
mirror of https://github.com/nikoksr/notify.git synced 2025-01-10 00:28:36 +02:00

Merge branch 'main' into feature/TwitterService

This commit is contained in:
Niko Köser 2021-02-05 14:37:35 +01:00 committed by GitHub
commit 2bda7f99bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 5 deletions

View File

@ -6,7 +6,7 @@ package notify
// E.g for telegram it sends the message to the specified group chat.
//
// The AddReceivers takes one or many strings and
// adds these to the list of destinations for recieving messages
// adds these to the list of destinations for receiving messages
// e.g. slack channels, telegram chats, email addresses.
type Notifier interface {
Send(string, string) error

View File

@ -18,7 +18,7 @@ type SMS struct {
// (https://help.pushbullet.com/articles/how-do-i-send-text-messages-from-my-computer/).
// For more information about Pushbullet api token:
// -> https://docs.pushbullet.com/#api-overview
func NewSMS(apiToken string, deviceNickname string) (*SMS, error) {
func NewSMS(apiToken, deviceNickname string) (*SMS, error) {
client := pushbullet.New(apiToken)
dev, err := client.Device(deviceNickname)

8
use.go
View File

@ -8,7 +8,9 @@ func (n *Notify) useService(service Notifier) {
n.notifiers = append(n.notifiers, service)
}
// UseService adds a given service to the notifiers services list.
func (n *Notify) UseService(service Notifier) {
n.useService(service)
// UseServices adds the given service(s) to the notifiers services list.
func (n *Notify) UseServices(service ...Notifier) {
for _, s := range service {
n.useService(s)
}
}