diff --git a/lib/core.go b/lib/core.go index 7385522..cd76551 100644 --- a/lib/core.go +++ b/lib/core.go @@ -303,7 +303,7 @@ func Clip(in io.Reader, out io.Writer, wi, hi, x0, y0, x1, y1, quality int) (err return nil } -func WaitStudy(user *User) { +func WaitStudy(user *User, id string) { i := 0 for i <= 180 { score, err := GetUserScore(user.Cookies) @@ -314,6 +314,7 @@ func WaitStudy(user *User) { score.Content["article"].CurrentScore >= score.Content["article"].MaxScore { return } + time.Sleep(10 * time.Second) i++ } diff --git a/lib/tg.go b/lib/tg.go index 3cf2844..a0eb194 100644 --- a/lib/tg.go +++ b/lib/tg.go @@ -313,9 +313,8 @@ func study(bot *Telegram, args []string) { defer datas.Delete(u) core.Init() defer core.Quit() - go core.LearnArticle(cookies) - go core.LearnVideo(cookies) - WaitStudy(&User{Cookies: cookies}) + core.LearnArticle(cookies) + core.LearnVideo(cookies) core.RespondDaily(cookies, "daily") core.RespondDaily(cookies, "weekly") core.RespondDaily(cookies, "special")