mirror of https://github.com/velour/catbase.git
meme: add user name
This commit is contained in:
parent
13a3af1e55
commit
2e746f7b80
|
@ -59,6 +59,7 @@ func (p *MemePlugin) registerWeb(c bot.Connector) {
|
||||||
r.ParseForm()
|
r.ParseForm()
|
||||||
log.Debug().Msgf("Meme:\n%+v", r.PostForm.Get("text"))
|
log.Debug().Msgf("Meme:\n%+v", r.PostForm.Get("text"))
|
||||||
channel := r.PostForm.Get("channel_id")
|
channel := r.PostForm.Get("channel_id")
|
||||||
|
user := r.PostForm.Get("user_name")
|
||||||
log.Debug().Msgf("channel: %s", channel)
|
log.Debug().Msgf("channel: %s", channel)
|
||||||
|
|
||||||
parts := strings.SplitN(r.PostForm.Get("text"), " ", 2)
|
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())
|
log.Debug().Msgf("image is at %s", u.String())
|
||||||
p.bot.Send(c, bot.Message, channel, "", bot.ImageAttachment{
|
p.bot.Send(c, bot.Message, channel, "", bot.ImageAttachment{
|
||||||
URL: u.String(),
|
URL: u.String(),
|
||||||
AltTxt: parts[1],
|
AltTxt: user,
|
||||||
})
|
})
|
||||||
w.Write(nil)
|
w.Write(nil)
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue