go: fix some format strings

This commit is contained in:
Chris Sexton 2020-10-09 10:54:09 -04:00
parent 9d33bbd675
commit 4ba240c37d
2 changed files with 4 additions and 4 deletions

View File

@ -55,7 +55,7 @@ func (d Discord) Send(kind bot.Kind, args ...interface{}) (string, error) {
if err != nil { if err != nil {
log.Error().Err(err).Msg("could not get original") log.Error().Err(err).Msg("could not get original")
} else { } else {
msg = fmt.Sprintf("> %s\n%s", original, msg) msg = fmt.Sprintf("> %v\n%s", original, msg)
} }
return d.sendMessage(args[0].(string), msg, false, args...) return d.sendMessage(args[0].(string), msg, false, args...)
case bot.Reaction: case bot.Reaction:

View File

@ -252,8 +252,8 @@ func (p *MemePlugin) bully(c bot.Connector, format, id string) image.Image {
func (p *MemePlugin) sendMeme(c bot.Connector, channel, channelName, msgID string, from *user.User, text string) { func (p *MemePlugin) sendMeme(c bot.Connector, channel, channelName, msgID string, from *user.User, text string) {
parts := strings.SplitN(text, " ", 2) parts := strings.SplitN(text, " ", 2)
if len(parts) != 2 { if len(parts) != 2 {
log.Debug().Msgf("Bad meme request: %s, %s", from, text) log.Debug().Msgf("Bad meme request: %v, %v", from, text)
p.bot.Send(c, bot.Message, channel, fmt.Sprintf("%s tried to send me a bad meme request.", from)) p.bot.Send(c, bot.Message, channel, fmt.Sprintf("%v tried to send me a bad meme request.", from.Name))
return return
} }
isCmd, message := bot.IsCmd(p.c, parts[1]) isCmd, message := bot.IsCmd(p.c, parts[1])
@ -278,7 +278,7 @@ func (p *MemePlugin) sendMeme(c bot.Connector, channel, channelName, msgID strin
id, w, h, err := p.genMeme(format, top, bottom, bullyImg) id, w, h, err := p.genMeme(format, top, bottom, bullyImg)
if err != nil { if err != nil {
msg := fmt.Sprintf("Hey %s, I couldn't download that image you asked for.", from) msg := fmt.Sprintf("Hey %v, I couldn't download that image you asked for.", from.Name)
p.bot.Send(c, bot.Message, channel, msg) p.bot.Send(c, bot.Message, channel, msg)
return return
} }