Skip to content

Commit

Permalink
fix: order by in /undelete
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTipo01 committed Sep 12, 2022
1 parent 8513e8c commit a893646
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ var (

toSend = "Last " + strconv.Itoa(int(number)) + " deleted messages:\n```"

rows, err := db.Query("SELECT message FROM messages WHERE deleted = 1 AND channelID=? ORDER BY messageID DESC LIMIT ?", i.ChannelID, number)
rows, err := db.Query("SELECT message FROM messages WHERE deleted = 1 AND channelID=? ORDER BY JSON_VALUE(message, '$.timestamp') DESC LIMIT ?", i.ChannelID, number)
if err != nil {
lit.Error("Can't query database, %s", err)
return
Expand Down

0 comments on commit a893646

Please sign in to comment.