Seklfreak / discord-image-downloader-go

A simple tool which downloads pictures posted in discord channels of your choice to a local folder.
MIT License
349 stars 91 forks source link

Download image posted by Bot #195

Open RinDevJunior opened 3 years ago

RinDevJunior commented 3 years ago

If the image is posted by Bot user, your code do not support it. image

So I make some change in your code to support this case image

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