Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.

Commit

Permalink
优化代码
Browse files Browse the repository at this point in the history
适配最最新 API
  • Loading branch information
XiaoMengXinX committed Oct 19, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 5744c03 commit 87e947f
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -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=
18 changes: 9 additions & 9 deletions main.go
Original file line number Diff line number Diff line change
@@ -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)
}

0 comments on commit 87e947f

Please sign in to comment.