Skip to content
This repository was archived by the owner on Nov 18, 2024. It is now read-only.

Commit 53d75ee

Browse files
committed
handles embed images and videos
1 parent 1423094 commit 53d75ee

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

main.go

+13-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ var (
7070
)
7171

7272
const (
73-
VERSION string = "1.26.1"
73+
VERSION string = "1.26.2"
7474
DATABASE_DIR string = "database"
7575
RELEASE_URL string = "https://github.com/Seklfreak/discord-image-downloader-go/releases/latest"
7676
RELEASE_API_URL string = "https://api.github.com/repos/Seklfreak/discord-image-downloader-go/releases/latest"
@@ -506,6 +506,18 @@ func handleDiscordMessage(m *discordgo.Message) {
506506
}
507507
}
508508
}
509+
if embed.Image != nil && embed.Image.URL != "" {
510+
links := getDownloadLinks(embed.Image.URL, m.ChannelID, false)
511+
for link, filename := range links {
512+
startDownload(link, filename, folderName, m.ChannelID, m.Author.ID, fileTime)
513+
}
514+
}
515+
if embed.Video != nil && embed.Video.URL != "" {
516+
links := getDownloadLinks(embed.Video.URL, m.ChannelID, false)
517+
for link, filename := range links {
518+
startDownload(link, filename, folderName, m.ChannelID, m.Author.ID, fileTime)
519+
}
520+
}
509521
}
510522
}
511523
} else if folderName, ok := InteractiveChannelWhitelist[m.ChannelID]; ok {

0 commit comments

Comments
 (0)