fix: check permissions for edit
This commit is contained in:
parent
2210a6dab9
commit
9e5c5aac5a
1 changed files with 6 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue