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:
commit
2bda7f99bf
@ -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
|
||||
|
@ -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
8
use.go
@ -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)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user