meme: fix shortcuts

This commit is contained in:
Chris Sexton 2020-04-28 15:16:45 -04:00
parent d2089279be
commit 66460159cd
1 changed files with 4 additions and 1 deletions

View File

@ -123,10 +123,13 @@ func (p *MemePlugin) genMeme(meme, text string) string {
} }
u, err := url.Parse(imgName) u, err := url.Parse(imgName)
if err != nil { if err != nil || u.Scheme == "" {
log.Debug().Err(err).Str("imgName", imgName).Msgf("url not detected")
u, _ = url.Parse("https://imgflip.com/s/meme/" + imgName) u, _ = url.Parse("https://imgflip.com/s/meme/" + imgName)
} }
log.Debug().Msgf("Attempting to download url: %s", u.String())
img := DownloadTemplate(u) img := DownloadTemplate(u)
r := img.Bounds() r := img.Bounds()
w := r.Dx() w := r.Dx()