update downloadto

This commit is contained in:
源文雨
2022-12-26 13:27:28 +08:00
parent fa8428ae8b
commit d0610b152f
8 changed files with 27 additions and 17 deletions

View File

@@ -17,6 +17,7 @@ import (
"github.com/wdvxdr1123/ZeroBot/utils/helper"
"github.com/FloatTech/floatbox/file"
"github.com/FloatTech/floatbox/process"
ctrl "github.com/FloatTech/zbpctrl"
"github.com/FloatTech/zbputils/control"
)
@@ -78,8 +79,9 @@ func init() {
return
}
}
err := file.DownloadTo(url, grpfolder+"/"+name, true)
err := file.DownloadTo(url, grpfolder+"/"+name)
if err == nil {
process.SleepAbout1sTo2s()
ctx.SendChain(message.Reply(ctx.Event.MessageID), message.Text("成功!"))
} else {
ctx.SendChain(message.Reply(ctx.Event.MessageID), message.Text("错误:", err.Error()))