add text if missing

This commit is contained in:
Chris Sexton 2020-05-21 14:56:18 -04:00 committed by Chris Sexton
parent 4cefc8a784
commit 645a533f49
1 changed files with 3 additions and 0 deletions

View File

@ -459,6 +459,9 @@ func (p *FactoidPlugin) sendImage(c bot.Connector, message msg.Message, msg stri
Str("msg", msg). Str("msg", msg).
Msg("Sending image attachment") Msg("Sending image attachment")
if imgSrc != "" { if imgSrc != "" {
if txt == "" {
txt = imgSrc
}
img := bot.ImageAttachment{ img := bot.ImageAttachment{
URL: imgSrc, URL: imgSrc,
AltTxt: txt, AltTxt: txt,