bugfix: handle lack of separate audio/video streams
All checks were successful
Build only (for PRs) / build-only (pull_request) Successful in 3m47s
All checks were successful
Build only (for PRs) / build-only (pull_request) Successful in 3m47s
This commit is contained in:
10
app/main.go
10
app/main.go
@@ -484,6 +484,16 @@ func fetchAndShowFormats(s *discordgo.Session, i *discordgo.InteractionCreate, u
|
|||||||
videoMenuOptions := buildVideoMenuOptions(formatOptions.VideoOptions)
|
videoMenuOptions := buildVideoMenuOptions(formatOptions.VideoOptions)
|
||||||
audioMenuOptions := buildAudioMenuOptions(formatOptions.AudioOptions)
|
audioMenuOptions := buildAudioMenuOptions(formatOptions.AudioOptions)
|
||||||
|
|
||||||
|
if len(videoMenuOptions) == 0 || len(audioMenuOptions) == 0 {
|
||||||
|
_, err = s.InteractionResponseEdit(i.Interaction, &discordgo.WebhookEdit{
|
||||||
|
Content: ptr("❌ No separate video/audio streams found for this URL. The source may only provide combined formats."),
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("Error updating interaction: %v", err)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
setInteractionState(i.Interaction.Token, &InteractionState{
|
setInteractionState(i.Interaction.Token, &InteractionState{
|
||||||
URL: url,
|
URL: url,
|
||||||
FormatOptions: formatOptions,
|
FormatOptions: formatOptions,
|
||||||
|
|||||||
Reference in New Issue
Block a user