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.
master
Luther Wen Xu 2019-12-12 13:32:38 +07:00
parent f4aa441899
commit 5e89a5d9f9
Signed by: chanbakjsd
GPG Key ID: B7D77E3E9D102B70
1 changed files with 2 additions and 2 deletions

@ -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,