From 0912f495192911707ed372c20ca0ec3ebf803526 Mon Sep 17 00:00:00 2001 From: Dustin Pianalto Date: Wed, 17 Jun 2020 22:12:14 -0800 Subject: [PATCH] Fix bug in user command when user has no roles --- djpianalto.com/goff/exts/utils.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/djpianalto.com/goff/exts/utils.go b/djpianalto.com/goff/exts/utils.go index ba2d410..b8a2056 100644 --- a/djpianalto.com/goff/exts/utils.go +++ b/djpianalto.com/goff/exts/utils.go @@ -118,7 +118,12 @@ func userCommand(ctx disgoman.Context, args []string) { for _, role := range roles { roleMentions = append(roleMentions, role.Mention()) } - rolesString := strings.Join(roleMentions, " ") + var rolesString string + if len(roleMentions) > 0 { + rolesString = strings.Join(roleMentions, " ") + } else { + rolesString = "None" + } rolesField := &discordgo.MessageEmbedField{ Name: "Roles:",