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

Commit 87e947f

Browse files
committed
优化代码
适配最最新 API
1 parent 5744c03 commit 87e947f

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
github.com/XiaoMengXinX/Music163Api-Go v0.1.9 h1:6sp0YIVqNYOmuig+ErtLvPMkwqPPc5ILEZ1lz+aV0xM=
2-
github.com/XiaoMengXinX/Music163Api-Go v0.1.9/go.mod h1:OOYCjlzn6o8+9avrp5fiOIRQotqIdC2X8NqM05s8fHI=
1+
github.com/XiaoMengXinX/Music163Api-Go v0.1.14 h1:aBr92X9RWv7JSGADnoTt2V6dNp3iXd5RAGp/ptkzkiI=
2+
github.com/XiaoMengXinX/Music163Api-Go v0.1.14/go.mod h1:4lcWLPwXMsTiwcyM6JBEAHkU7NUvYJOMPtfiUj9X0Jw=
33
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
44
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
55
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=

main.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ func musicianTasks(userData types.LoginStatusData, data utils.RequestData, autoT
252252
case 393001:
253253
log.Printf("[%s] 执行回复评论任务中", userData.Profile.Nickname)
254254
commentConfig := api.CommentConfig{
255-
ResType: 0,
255+
ResType: api.ResTypeMusic,
256256
ResID: config.CommentConfig.RepliedComment[processingUser].MusicID,
257257
CommentID: config.CommentConfig.RepliedComment[processingUser].CommentID,
258258
ForwardEvent: false,
@@ -279,7 +279,7 @@ func musicianTasks(userData types.LoginStatusData, data utils.RequestData, autoT
279279
case 396002:
280280
log.Printf("[%s] 执行发主创说任务中", userData.Profile.Nickname)
281281
commentConfig := api.CommentConfig{
282-
ResType: 0,
282+
ResType: api.ResTypeMusic,
283283
ResID: config.CommentConfig.RepliedComment[processingUser].MusicID,
284284
ForwardEvent: false,
285285
}
@@ -335,7 +335,7 @@ func sendEventTask(userData types.LoginStatusData, data utils.RequestData) error
335335
time.Sleep(time.Duration(randomLag) * time.Second)
336336
}
337337
}
338-
delResult, err := api.DelEvent(data, int(sendResult.Event.Id))
338+
delResult, err := api.DelEvent(data, sendResult.Event.Id)
339339
if err != nil {
340340
return err
341341
}
@@ -381,8 +381,8 @@ func replyCommentTask(userData types.LoginStatusData, commentConfig api.CommentC
381381
time.Sleep(time.Duration(randomLag) * time.Second)
382382
}
383383
}
384-
commentConfig.CommentID = int(replyResult.Comment.CommentId)
385-
commentConfig.ResType = 0
384+
commentConfig.CommentID = replyResult.Comment.CommentId
385+
commentConfig.ResType = api.ResTypeMusic
386386
commentConfig.Content = ""
387387
delResult, err := api.DelComment(data, commentConfig)
388388
if err != nil {
@@ -473,7 +473,7 @@ func sendMlogTask(userData types.LoginStatusData, data utils.RequestData) error
473473
log.Printf("[%s] 延时 %d 秒", userData.Profile.Nickname, randomLag)
474474
time.Sleep(time.Duration(randomLag) * time.Second)
475475
}
476-
result, err := api.DelEvent(data, int(mlogData.Data.Event.Id))
476+
result, err := api.DelEvent(data, mlogData.Data.Event.Id)
477477
if err != nil {
478478
return err
479479
}
@@ -501,8 +501,8 @@ func musicianSaidTask(userData types.LoginStatusData, commentConfig api.CommentC
501501
time.Sleep(time.Duration(randomLag) * time.Second)
502502
}
503503
}
504-
commentConfig.CommentID = int(replyResult.Comment.CommentId)
505-
commentConfig.ResType = 0
504+
commentConfig.CommentID = replyResult.Comment.CommentId
505+
commentConfig.ResType = api.ResTypeMusic
506506
commentConfig.Content = ""
507507
delResult, err := api.DelComment(data, commentConfig)
508508
if err != nil {
@@ -536,7 +536,7 @@ func checkCloudBean(userData types.LoginStatusData, data utils.RequestData) ([]i
536536
if tasksData.Data.List[i].Status == 20 {
537537
log.Printf("[%s] 「%s」任务已完成, 正在领取云豆", userData.Profile.Nickname, tasksData.Data.List[i].Description)
538538
isObtainCloudBean = true
539-
result, err := api.ObtainCloudbean(data, int(tasksData.Data.List[i].UserMissionId), tasksData.Data.List[i].Period)
539+
result, err := api.ObtainCloudbean(data, tasksData.Data.List[i].UserMissionId, tasksData.Data.List[i].Period)
540540
if err != nil {
541541
log.Errorln(err)
542542
}

0 commit comments

Comments
 (0)