minor UX tweaks
This commit is contained in:
@@ -20,7 +20,7 @@ func startAsyncDownload(s *discordgo.Session, i *discordgo.InteractionCreate, re
|
||||
// Handle panic from DownloadVideo
|
||||
resultChan <- DownloadResult{
|
||||
Success: false,
|
||||
Message: fmt.Sprintf("Download failed: %v", r),
|
||||
Message: fmt.Sprintf("❌ **Download Failed**: %v", r),
|
||||
URL: url,
|
||||
Format: fmt.Sprintf("video: %s, audio: %s", videoFormatID, audioFormatID),
|
||||
Error: fmt.Errorf("%v", r),
|
||||
@@ -39,7 +39,7 @@ func startAsyncDownload(s *discordgo.Session, i *discordgo.InteractionCreate, re
|
||||
// If we reach here, download was successful
|
||||
resultChan <- DownloadResult{
|
||||
Success: true,
|
||||
Message: "Video Downloaded Successfully!",
|
||||
Message: "✅ **Successfully Downloaded**",
|
||||
URL: url,
|
||||
Format: fmt.Sprintf("video: %s, audio: %s", videoFormatID, audioFormatID),
|
||||
Error: nil,
|
||||
@@ -49,7 +49,7 @@ func startAsyncDownload(s *discordgo.Session, i *discordgo.InteractionCreate, re
|
||||
// Handle progress and results asynchronously
|
||||
go func() {
|
||||
_, err := s.InteractionResponseEdit(i.Interaction, &discordgo.WebhookEdit{
|
||||
Content: ptr("<a:loading:1479131733910618153> downloading: starting..."),
|
||||
Content: ptr(fmt.Sprintf("%s **Starting Download**", loading_emoji)),
|
||||
})
|
||||
if err != nil {
|
||||
log.Printf("Error updating interaction: %v", err)
|
||||
@@ -65,7 +65,7 @@ func startAsyncDownload(s *discordgo.Session, i *discordgo.InteractionCreate, re
|
||||
|
||||
var content string
|
||||
if prog.Phase == "post-processing" {
|
||||
content = "<a:loading:1479131733910618153> post-processing"
|
||||
content = fmt.Sprintf("%s **Post Processing**", loading_emoji)
|
||||
} else {
|
||||
var progressStr string
|
||||
if prog.DownloadedBytes > 0 {
|
||||
@@ -73,7 +73,7 @@ func startAsyncDownload(s *discordgo.Session, i *discordgo.InteractionCreate, re
|
||||
} else {
|
||||
progressStr = "starting..."
|
||||
}
|
||||
content = fmt.Sprintf("<a:loading:1479131733910618153> Downloading Video: %s", progressStr)
|
||||
content = fmt.Sprintf("%s **Downloading Video**: %s", loading_emoji, progressStr)
|
||||
}
|
||||
|
||||
_, err := s.InteractionResponseEdit(i.Interaction, &discordgo.WebhookEdit{
|
||||
@@ -86,7 +86,7 @@ func startAsyncDownload(s *discordgo.Session, i *discordgo.InteractionCreate, re
|
||||
case result := <-resultChan:
|
||||
if result.Success {
|
||||
_, err = s.InteractionResponseEdit(i.Interaction, &discordgo.WebhookEdit{
|
||||
Content: ptr("✅ Success"),
|
||||
Content: ptr("✅ **Successfully Downloaded**"),
|
||||
})
|
||||
_, err = s.FollowupMessageCreate(i.Interaction, false, &discordgo.WebhookParams{
|
||||
Content: fmt.Sprintf("## Video Downloaded \n**URL**: %s \n**Quality**: %s + %s \n**Requested By**: <@%s> \n", result.URL, videoFormatName, audioFormatName, requester),
|
||||
@@ -96,7 +96,7 @@ func startAsyncDownload(s *discordgo.Session, i *discordgo.InteractionCreate, re
|
||||
}
|
||||
} else {
|
||||
_, err = s.InteractionResponseEdit(i.Interaction, &discordgo.WebhookEdit{
|
||||
Content: ptr("❌ Download failed: " + result.Message),
|
||||
Content: ptr("❌ **Download Failed**: " + result.Message),
|
||||
})
|
||||
if err != nil {
|
||||
log.Printf("Error updating interaction: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user