refactor(notifications): lint

This commit is contained in:
ayn2op 2025-09-25 11:33:38 -04:00
parent aab7d6ed09
commit 998e05a4f7
3 changed files with 9 additions and 9 deletions

View file

@ -4,8 +4,8 @@ package notifications
import "github.com/gen2brain/beeep"
func sendDesktopNotification(title string, body string, image string, playSound bool, duration int) error {
if err := beeep.Notify(title, body, image); err != nil {
func sendDesktopNotification(title string, message string, image string, playSound bool, duration int) error {
if err := beeep.Notify(title, message, image); err != nil {
return err
}

View file

@ -6,14 +6,14 @@ import (
gosxnotifier "github.com/deckarep/gosx-notifier"
)
func sendDesktopNotification(title string, body string, image string, playSound bool, _ int) error {
notify := gosxnotifier.NewNotification(body)
notify.Title = title
notify.ContentImage = image
func sendDesktopNotification(title string, message string, image string, playSound bool, _ int) error {
n := gosxnotifier.NewNotification(message)
n.Title = title
n.ContentImage = image
if playSound {
notify.Sound = gosxnotifier.Default
n.Sound = gosxnotifier.Default
}
return notify.Push()
return n.Push()
}

View file

@ -28,7 +28,7 @@ func Notify(state *ningen.State, msg *gateway.MessageCreateEvent, cfg *config.Co
// Handle sent files
content := msg.Content
if msg.Content == "" && len(msg.Attachments) > 0 {
content = "Uploaded " + msg.Message.Attachments[0].Filename
content = "Uploaded " + msg.Attachments[0].Filename
}
if content == "" {