Fix bug in user command when user has no roles

This commit is contained in:
Dustin Pianalto 2020-06-17 22:12:14 -08:00
parent 7151f289b1
commit 0912f49519

View File

@ -118,7 +118,12 @@ func userCommand(ctx disgoman.Context, args []string) {
for _, role := range roles { for _, role := range roles {
roleMentions = append(roleMentions, role.Mention()) 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{ rolesField := &discordgo.MessageEmbedField{
Name: "Roles:", Name: "Roles:",