From 9e5c5aac5acf81d0091c9a713312846aa4aaf012 Mon Sep 17 00:00:00 2001 From: ayn2op Date: Tue, 30 Sep 2025 12:12:16 -0400 Subject: [PATCH] fix: check permissions for edit --- cmd/messages_list.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/messages_list.go b/cmd/messages_list.go index 71f7588..faf2c07 100644 --- a/cmd/messages_list.go +++ b/cmd/messages_list.go @@ -568,6 +568,12 @@ func (ml *messagesList) edit() { return } + clientID := discordState.Ready().User.ID + if message.Author.ID != clientID { + slog.Error("failed to edit message; not the author", "channel_id", message.ChannelID, "message_id", message.ID) + return + } + app.messageInput.SetTitle("Editing") app.messageInput.edit = true app.messageInput.SetText(message.Content, true)