add author name to sub command

This commit is contained in:
Arkitu 2026-01-18 23:49:25 +01:00
parent ebd4bf8002
commit b9d8f9e197

View File

@ -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,
},