From 87e947f369d55747233516e262dfd1fdce19f169 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?lz=E5=B7=B2=E7=BB=8F=E6=98=AF=E6=9D=A1=E5=92=B8=E9=B1=BC?= =?UTF-8?q?=E4=BA=86?= Date: Tue, 19 Oct 2021 13:15:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81=20?= =?UTF-8?q?=E9=80=82=E9=85=8D=E6=9C=80=E6=9C=80=E6=96=B0=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go.sum | 4 ++-- main.go | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/go.sum b/go.sum index 5a1d21c..3f7262a 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/XiaoMengXinX/Music163Api-Go v0.1.9 h1:6sp0YIVqNYOmuig+ErtLvPMkwqPPc5ILEZ1lz+aV0xM= -github.com/XiaoMengXinX/Music163Api-Go v0.1.9/go.mod h1:OOYCjlzn6o8+9avrp5fiOIRQotqIdC2X8NqM05s8fHI= +github.com/XiaoMengXinX/Music163Api-Go v0.1.14 h1:aBr92X9RWv7JSGADnoTt2V6dNp3iXd5RAGp/ptkzkiI= +github.com/XiaoMengXinX/Music163Api-Go v0.1.14/go.mod h1:4lcWLPwXMsTiwcyM6JBEAHkU7NUvYJOMPtfiUj9X0Jw= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= diff --git a/main.go b/main.go index ad40715..34f2376 100644 --- a/main.go +++ b/main.go @@ -252,7 +252,7 @@ func musicianTasks(userData types.LoginStatusData, data utils.RequestData, autoT case 393001: log.Printf("[%s] 执行回复评论任务中", userData.Profile.Nickname) commentConfig := api.CommentConfig{ - ResType: 0, + ResType: api.ResTypeMusic, ResID: config.CommentConfig.RepliedComment[processingUser].MusicID, CommentID: config.CommentConfig.RepliedComment[processingUser].CommentID, ForwardEvent: false, @@ -279,7 +279,7 @@ func musicianTasks(userData types.LoginStatusData, data utils.RequestData, autoT case 396002: log.Printf("[%s] 执行发主创说任务中", userData.Profile.Nickname) commentConfig := api.CommentConfig{ - ResType: 0, + ResType: api.ResTypeMusic, ResID: config.CommentConfig.RepliedComment[processingUser].MusicID, ForwardEvent: false, } @@ -335,7 +335,7 @@ func sendEventTask(userData types.LoginStatusData, data utils.RequestData) error time.Sleep(time.Duration(randomLag) * time.Second) } } - delResult, err := api.DelEvent(data, int(sendResult.Event.Id)) + delResult, err := api.DelEvent(data, sendResult.Event.Id) if err != nil { return err } @@ -381,8 +381,8 @@ func replyCommentTask(userData types.LoginStatusData, commentConfig api.CommentC time.Sleep(time.Duration(randomLag) * time.Second) } } - commentConfig.CommentID = int(replyResult.Comment.CommentId) - commentConfig.ResType = 0 + commentConfig.CommentID = replyResult.Comment.CommentId + commentConfig.ResType = api.ResTypeMusic commentConfig.Content = "" delResult, err := api.DelComment(data, commentConfig) if err != nil { @@ -473,7 +473,7 @@ func sendMlogTask(userData types.LoginStatusData, data utils.RequestData) error log.Printf("[%s] 延时 %d 秒", userData.Profile.Nickname, randomLag) time.Sleep(time.Duration(randomLag) * time.Second) } - result, err := api.DelEvent(data, int(mlogData.Data.Event.Id)) + result, err := api.DelEvent(data, mlogData.Data.Event.Id) if err != nil { return err } @@ -501,8 +501,8 @@ func musicianSaidTask(userData types.LoginStatusData, commentConfig api.CommentC time.Sleep(time.Duration(randomLag) * time.Second) } } - commentConfig.CommentID = int(replyResult.Comment.CommentId) - commentConfig.ResType = 0 + commentConfig.CommentID = replyResult.Comment.CommentId + commentConfig.ResType = api.ResTypeMusic commentConfig.Content = "" delResult, err := api.DelComment(data, commentConfig) if err != nil { @@ -536,7 +536,7 @@ func checkCloudBean(userData types.LoginStatusData, data utils.RequestData) ([]i if tasksData.Data.List[i].Status == 20 { log.Printf("[%s] 「%s」任务已完成, 正在领取云豆", userData.Profile.Nickname, tasksData.Data.List[i].Description) isObtainCloudBean = true - result, err := api.ObtainCloudbean(data, int(tasksData.Data.List[i].UserMissionId), tasksData.Data.List[i].Period) + result, err := api.ObtainCloudbean(data, tasksData.Data.List[i].UserMissionId, tasksData.Data.List[i].Period) if err != nil { log.Errorln(err) }