From 66460159cd52371bedca0f3bfc454b56f0a42d58 Mon Sep 17 00:00:00 2001 From: Chris Sexton Date: Tue, 28 Apr 2020 15:16:45 -0400 Subject: [PATCH] meme: fix shortcuts --- plugins/meme/meme.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/meme/meme.go b/plugins/meme/meme.go index 1daf49d..3648aa3 100644 --- a/plugins/meme/meme.go +++ b/plugins/meme/meme.go @@ -123,10 +123,13 @@ func (p *MemePlugin) genMeme(meme, text string) string { } 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) } + log.Debug().Msgf("Attempting to download url: %s", u.String()) + img := DownloadTemplate(u) r := img.Bounds() w := r.Dx()