From b9d8f9e19766a135b944f1016961406935144a7a Mon Sep 17 00:00:00 2001 From: Arkitu Date: Sun, 18 Jan 2026 23:49:25 +0100 Subject: [PATCH] add author name to sub command --- main.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 3cfa4e9..14ff801 100644 --- a/main.go +++ b/main.go @@ -151,12 +151,18 @@ var handlers = map[string]func(*dg.Session, *dg.InteractionCreate){ guesses = append(guesses, strconv.Itoa(guessRank+1)+": <@"+guess+">") } + var cmdAuthor string + if i.Member != nil { + cmdAuthor = i.Member.DisplayName() + } else { + cmdAuthor = i.User.DisplayName() + } s.InteractionRespond(i.Interaction, &dg.InteractionResponse{ Type: dg.InteractionResponseChannelMessageWithSource, Data: &dg.InteractionResponseData{ Embeds: []*dg.MessageEmbed{ { - Title: "Guess", + Title: "Guess by " + cmdAuthor, Description: strings.Join(guesses, "\n") + "\n\n**" + strconv.Itoa(green) + " 🟩**\n**" + strconv.Itoa(red) + " 🟥**", Color: stg.Color, },