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.![image](https://user-images.githubusercontent.com/22781131/103964589-63698e00-518e-11eb-9bb1-5745370b85c3.png)
So I make some change in your code to support this case![image](https://user-images.githubusercontent.com/22781131/103964632-7aa87b80-518e-11eb-8bd1-e1095951bafb.png)
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