From bca733a352b0a0f73d13b2a36e5c8fa7278c375c Mon Sep 17 00:00:00 2001 From: ayn2op Date: Fri, 25 Jul 2025 18:17:07 -0400 Subject: [PATCH] refactor(notifications): rename HandleIncomingMessage to Notify --- cmd/state.go | 2 +- go.sum | 2 -- internal/notifications/notifications.go | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/cmd/state.go b/cmd/state.go index 16c2898..d9427f6 100644 --- a/cmd/state.go +++ b/cmd/state.go @@ -165,7 +165,7 @@ func onMessageCreate(message *gateway.MessageCreateEvent) { app.Draw() } - if err := notifications.HandleIncomingMessage(discordState, message, app.cfg); err != nil { + if err := notifications.Notify(discordState, message, app.cfg); err != nil { slog.Error("Notification failed", "err", err) } } diff --git a/go.sum b/go.sum index 69f2c8f..9c7bf71 100644 --- a/go.sum +++ b/go.sum @@ -166,8 +166,6 @@ github.com/tadvi/systray v0.0.0-20190226123456-11a2b8fa57af/go.mod h1:4F09kP5F+a github.com/twmb/murmur3 v1.1.8 h1:8Yt9taO/WN3l08xErzjeschgZU2QSrwm1kclYq+0aRg= github.com/twmb/murmur3 v1.1.8/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq3OSQ= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/yuin/goldmark v1.7.12 h1:YwGP/rrea2/CnCtUHgjuolG/PnMxdQtPMO5PvaE2/nY= -github.com/yuin/goldmark v1.7.12/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= github.com/yuin/goldmark v1.7.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= github.com/zalando/go-keyring v0.2.6 h1:r7Yc3+H+Ux0+M72zacZoItR3UDxeWfKTcabvkI8ua9s= diff --git a/internal/notifications/notifications.go b/internal/notifications/notifications.go index 33f10e9..6826af6 100644 --- a/internal/notifications/notifications.go +++ b/internal/notifications/notifications.go @@ -15,7 +15,7 @@ import ( "github.com/diamondburned/ningen/v3" ) -func HandleIncomingMessage(state *ningen.State, msg *gateway.MessageCreateEvent, cfg *config.Config) error { +func Notify(state *ningen.State, msg *gateway.MessageCreateEvent, cfg *config.Config) error { // Only display notification if enabled and unmuted if !cfg.Notifications.Enabled || state.MessageMentions(&msg.Message) == 0 || cfg.Status == discord.DoNotDisturbStatus { return nil