From 0453c5ec245c5c1001cdc461380d2cd0d22afdef Mon Sep 17 00:00:00 2001 From: Chris Sexton <3216719+chrissexton@users.noreply.github.com> Date: Sat, 23 Jul 2022 08:47:01 -0400 Subject: [PATCH] cowboy: show the emojy when its made --- plugins/cowboy/cowboy.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/cowboy/cowboy.go b/plugins/cowboy/cowboy.go index c1dfaa5..05e1c43 100644 --- a/plugins/cowboy/cowboy.go +++ b/plugins/cowboy/cowboy.go @@ -148,6 +148,7 @@ func (p *Cowboy) mkOverlayCB(overlay string) func(s *discordgo.Session, i *disco return func(s *discordgo.Session, i *discordgo.InteractionCreate) { lastEmojy := p.c.Get("cowboy.lastEmojy", "rust") emojyPlugin := emojy.NewAPI(p.b) + list := map[string]string{} name := i.ApplicationCommandData().Options[0].StringValue() if overlay == "" { @@ -183,7 +184,14 @@ func (p *Cowboy) mkOverlayCB(overlay string) func(s *discordgo.Session, i *disco p.c.Set("cowboy.lastEmojy", name) - msg = fmt.Sprintf("You replaced %s with a new emojy %s, pardner!", lastEmojy, name) + list = p.b.DefaultConnector().GetEmojiList(true) + for k, v := range list { + if v == name { + msg = fmt.Sprintf("You replaced %s with a new emojy %s <:%s:%s>, pardner!", lastEmojy, name, name, k) + goto resp + } + } + msg = "Something probably went wrong. I don't see your new emojy, pardner." resp: s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{