From 5e89a5d9f9db6e1d59cf5ccb8e151c13f3332fa9 Mon Sep 17 00:00:00 2001 From: Luther Wen Xu Date: Thu, 12 Dec 2019 13:32:38 +0800 Subject: [PATCH] modules/starboard: Fix starboard thumbnail The code was looking in embeds when Discord places it in attachments. This has been rectified by making the code look in attachments instead. --- modules/starboard/starboard.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/starboard/starboard.go b/modules/starboard/starboard.go index 17d591f..f48c22b 100644 --- a/modules/starboard/starboard.go +++ b/modules/starboard/starboard.go @@ -90,8 +90,8 @@ func ReactListener(s *discordgo.Session, m *discordgo.MessageReactionAdd) { IconURL: "https://cdn.discordapp.com/avatars/" + msg.Author.ID + "/" + msg.Author.Avatar + ".png", }, } - if len(msg.Embeds) > 0 && msg.Embeds[0].Image != nil { - img := msg.Embeds[0].Image + if len(msg.Attachments) > 0 && msg.Attachments[0] != nil && msg.Attachments[0].Width > 0 { + img := msg.Attachments[0] embed.Thumbnail = &discordgo.MessageEmbedThumbnail{ URL: img.URL, ProxyURL: img.ProxyURL,