Skip to content

Commit

Permalink
fix: possible out of bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTipo01 committed Nov 10, 2023
1 parent 973780a commit 519025e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,9 @@ var (
message += c + ", "
}

message = message[:len(message)-2]
if len(message) >= 2 {
message = message[:len(message)-2]
}

sendAndDeleteEmbedInteraction(s, NewEmbed().SetTitle(s.State.User.Username).AddField("Commands", message).
SetColor(0x7289DA).MessageEmbed, i.Interaction, time.Second*30)
Expand Down

0 comments on commit 519025e

Please sign in to comment.