From d37b5028e13210ccf122df18dee0492b0027d7cf Mon Sep 17 00:00:00 2001 From: Ping Chen Date: Wed, 9 Apr 2025 20:37:25 +0900 Subject: [PATCH] portal: fix isPlainGifMessage to get link preview working (#179) --- portal_convert.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/portal_convert.go b/portal_convert.go index cb4dc7b..62621ba 100644 --- a/portal_convert.go +++ b/portal_convert.go @@ -634,7 +634,7 @@ func isPlainGifMessage(msg *discordgo.Message) bool { } embed := msg.Embeds[0] isGifVideo := embed.Type == discordgo.EmbedTypeGifv && embed.Video != nil - isGifImage := embed.Type == discordgo.EmbedTypeImage && embed.Image == nil && embed.Thumbnail != nil + isGifImage := embed.Type == discordgo.EmbedTypeImage && embed.Image == nil && embed.Thumbnail != nil && embed.Title == "" contentIsOnlyURL := msg.Content == embed.URL || discordLinkRegexFull.MatchString(msg.Content) return contentIsOnlyURL && (isGifVideo || isGifImage) }