Jelajahi Sumber

refactor(notifications): lint

ayn2op 7 bulan lalu
induk
melakukan
998e05a4f7

+ 2 - 2
internal/notifications/desktop_toast.go

@@ -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
 	}
 

+ 6 - 6
internal/notifications/desktop_toast_darwin.go

@@ -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()
 }

+ 1 - 1
internal/notifications/notifications.go

@@ -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 == "" {