From 519025efc2d08748d8a18dce3db54777946f8798 Mon Sep 17 00:00:00 2001 From: Manuel Raimo Date: Fri, 10 Nov 2023 19:05:26 +0100 Subject: [PATCH] fix: possible out of bounds --- commands.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/commands.go b/commands.go index 08678f6..a552ac8 100644 --- a/commands.go +++ b/commands.go @@ -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)