From 435f45fa7ce4b62309d1ba7aae72e8037320740c Mon Sep 17 00:00:00 2001 From: Chris Sexton <3216719+chrissexton@users.noreply.github.com> Date: Fri, 14 Oct 2022 08:45:12 -0400 Subject: [PATCH] tappd: shorten the message on images --- plugins/tappd/tappd.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/tappd/tappd.go b/plugins/tappd/tappd.go index 97a0036..0596fce 100644 --- a/plugins/tappd/tappd.go +++ b/plugins/tappd/tappd.go @@ -112,13 +112,13 @@ func (p *Tappd) registerDiscord(d *discord.Discord) { func (p *Tappd) tap(s *discordgo.Session, i *discordgo.InteractionCreate) { who := i.Interaction.Member.Nick channel := i.Interaction.ChannelID - msg := fmt.Sprintf("%s checked in: %s", - i.Interaction.Member.Nick, - i.ApplicationCommandData().Options[1].StringValue()) + shortMsg := i.ApplicationCommandData().Options[1].StringValue() + longMsg := fmt.Sprintf("%s checked in: %s", + i.Interaction.Member.Nick, shortMsg) attachID := i.ApplicationCommandData().Options[0].Value.(string) attach := i.ApplicationCommandData().Resolved.Attachments[attachID] spec := defaultSpec() - spec.text = msg + spec.text = shortMsg info, err := p.getAndOverlay(attachID, attach.URL, []textSpec{spec}) if err != nil { log.Error().Err(err).Msgf("error with interaction") @@ -135,7 +135,7 @@ func (p *Tappd) tap(s *discordgo.Session, i *discordgo.InteractionCreate) { return } embed := &discordgo.MessageEmbed{ - Description: msg, + Description: longMsg, Image: &discordgo.MessageEmbedImage{ URL: info.BotURL, Width: info.W, @@ -152,7 +152,7 @@ func (p *Tappd) tap(s *discordgo.Session, i *discordgo.InteractionCreate) { log.Error().Err(err).Msgf("error with interaction") return } - err = p.log(who, channel, msg) + err = p.log(who, channel, shortMsg) if err != nil { log.Error().Err(err).Msgf("error recording tap") }