Open RinDevJunior opened 3 years ago
If the image is posted by Bot user, your code do not support it.
So I make some change in your code to support this case
From line 226. if msg.Embeds != nil && len(msg.Embeds) > 0 && msg.Embeds[0].Image != nil { i++ url := msg.Embeds[0].Image.URL parts := strings.Split(url, "/") fileName := parts[len(parts)-1] startDownload(url, fileName, folder, msg.ChannelID, msg.Author.ID, fileTime) }
if msg.Embeds != nil && len(msg.Embeds) > 0 && msg.Embeds[0].Image != nil { i++ url := msg.Embeds[0].Image.URL parts := strings.Split(url, "/") fileName := parts[len(parts)-1] startDownload(url, fileName, folder, msg.ChannelID, msg.Author.ID, fileTime) }
You can use this snipet if you want. Cheer
Note: I wrote this for download old image
If the image is posted by Bot user, your code do not support it.
So I make some change in your code to support this case
From line 226.
if msg.Embeds != nil && len(msg.Embeds) > 0 && msg.Embeds[0].Image != nil { i++ url := msg.Embeds[0].Image.URL parts := strings.Split(url, "/") fileName := parts[len(parts)-1] startDownload(url, fileName, folder, msg.ChannelID, msg.Author.ID, fileTime) }
You can use this snipet if you want. Cheer
Note: I wrote this for download old image