add author name to sub command
This commit is contained in:
parent
ebd4bf8002
commit
b9d8f9e197
8
main.go
8
main.go
@ -151,12 +151,18 @@ var handlers = map[string]func(*dg.Session, *dg.InteractionCreate){
|
|||||||
|
|
||||||
guesses = append(guesses, strconv.Itoa(guessRank+1)+": <@"+guess+">")
|
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{
|
s.InteractionRespond(i.Interaction, &dg.InteractionResponse{
|
||||||
Type: dg.InteractionResponseChannelMessageWithSource,
|
Type: dg.InteractionResponseChannelMessageWithSource,
|
||||||
Data: &dg.InteractionResponseData{
|
Data: &dg.InteractionResponseData{
|
||||||
Embeds: []*dg.MessageEmbed{
|
Embeds: []*dg.MessageEmbed{
|
||||||
{
|
{
|
||||||
Title: "Guess",
|
Title: "Guess by " + cmdAuthor,
|
||||||
Description: strings.Join(guesses, "\n") + "\n\n**" + strconv.Itoa(green) + " 🟩**\n**" + strconv.Itoa(red) + " 🟥**",
|
Description: strings.Join(guesses, "\n") + "\n\n**" + strconv.Itoa(green) + " 🟩**\n**" + strconv.Itoa(red) + " 🟥**",
|
||||||
Color: stg.Color,
|
Color: stg.Color,
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user