meme: add user name

This commit is contained in:
Chris Sexton 2020-04-28 11:48:39 -04:00
parent 13a3af1e55
commit 2e746f7b80
1 changed files with 2 additions and 1 deletions

View File

@ -59,6 +59,7 @@ func (p *MemePlugin) registerWeb(c bot.Connector) {
r.ParseForm()
log.Debug().Msgf("Meme:\n%+v", r.PostForm.Get("text"))
channel := r.PostForm.Get("channel_id")
user := r.PostForm.Get("user_name")
log.Debug().Msgf("channel: %s", channel)
parts := strings.SplitN(r.PostForm.Get("text"), " ", 2)
@ -73,7 +74,7 @@ func (p *MemePlugin) registerWeb(c bot.Connector) {
log.Debug().Msgf("image is at %s", u.String())
p.bot.Send(c, bot.Message, channel, "", bot.ImageAttachment{
URL: u.String(),
AltTxt: parts[1],
AltTxt: user,
})
w.Write(nil)
})