diff --git a/main.go b/main.go index 684138f..2f71526 100644 --- a/main.go +++ b/main.go @@ -96,15 +96,12 @@ func init() { func send_error(s *dg.Session, i *dg.Interaction, reason string) { log.Printf("Sending error (\"%s\")", reason) - s.InteractionRespond(i, &dg.InteractionResponse{ - Type: dg.InteractionResponseChannelMessageWithSource, - Data: &dg.InteractionResponseData{ - Embeds: []*dg.MessageEmbed{ - { - Title: "⚠️ Error", - Description: reason, - Color: 0xFF0000, - }, + s.InteractionResponseEdit(i, &dg.WebhookEdit{ + Embeds: &[]*dg.MessageEmbed{ + { + Title: "⚠️ Error", + Description: reason, + Color: 0xFF0000, }, }, }) @@ -121,6 +118,9 @@ var handlers = map[string]func(*dg.Session, *dg.InteractionCreate){ }) }, "sub": func(s *dg.Session, i *dg.InteractionCreate) { + s.InteractionRespond(i.Interaction, &dg.InteractionResponse{ + Type: dg.InteractionResponseDeferredChannelMessageWithSource, + }) red := 0 green := 0 guesses := []string{} @@ -182,15 +182,12 @@ var handlers = map[string]func(*dg.Session, *dg.InteractionCreate){ } else { title = "Guess by " + cmdAuthor } - s.InteractionRespond(i.Interaction, &dg.InteractionResponse{ - Type: dg.InteractionResponseChannelMessageWithSource, - Data: &dg.InteractionResponseData{ - Embeds: []*dg.MessageEmbed{ - { - Title: title, - Description: strings.Join(guesses, "\n") + "\n\n**" + strconv.Itoa(green) + " 🟩**\n**" + strconv.Itoa(red) + " 🟥**", - Color: stg.Color, - }, + s.InteractionResponseEdit(i.Interaction, &dg.WebhookEdit{ + Embeds: &[]*dg.MessageEmbed{ + { + Title: title, + Description: strings.Join(guesses, "\n") + "\n\n**" + strconv.Itoa(green) + " 🟩**\n**" + strconv.Itoa(red) + " 🟥**", + Color: stg.Color, }, }, })