diff --git a/lib/config.go b/lib/config.go index a7e5553..5cbb448 100644 --- a/lib/config.go +++ b/lib/config.go @@ -30,6 +30,12 @@ type Config struct { ChatID int64 `json:"chat_id" yaml:"chat_id"` Proxy string `json:"proxy" yaml:"proxy"` } `json:"tg" yaml:"tg"` + Web struct { + Account string `json:"account"` + Password string `json:"password"` + Host string `json:"host"` + Port int `json:"port"` + } `json:"web"` Cron string `json:"cron"` } @@ -42,6 +48,11 @@ var ( //go:embed config_default.yml var defaultConfig []byte +// GetConfig +/** + * @Description: + * @return Config + */ func GetConfig() Config { file, err := os.ReadFile("./config/config.yml") if err != nil { diff --git a/lib/score.go b/lib/score.go index 14d2670..3bb12e3 100644 --- a/lib/score.go +++ b/lib/score.go @@ -11,14 +11,14 @@ import ( ) type Score struct { - TotalScore int - TodayScore int - Content map[string]Data + TotalScore int `json:"total_score"` + TodayScore int `json:"today_score"` + Content map[string]Data `json:"content"` } type Data struct { - CurrentScore int - MaxScore int + CurrentScore int `json:"current_score"` + MaxScore int `json:"max_score"` } func GetUserScore(cookies []Cookie) (Score, error) { diff --git a/lib/tg.go b/lib/tg.go index 89b76b1..3cf2844 100644 --- a/lib/tg.go +++ b/lib/tg.go @@ -313,8 +313,8 @@ func study(bot *Telegram, args []string) { defer datas.Delete(u) core.Init() defer core.Quit() - core.LearnArticle(cookies) - core.LearnVideo(cookies) + go core.LearnArticle(cookies) + go core.LearnVideo(cookies) WaitStudy(&User{Cookies: cookies}) core.RespondDaily(cookies, "daily") core.RespondDaily(cookies, "weekly")