-
Notifications
You must be signed in to change notification settings - Fork 2k
🐛修复点歌 #1277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
🐛修复点歌 #1277
Conversation
plugin/music/selecter.go
Outdated
| // 执行点播并返回结果 | ||
| seg, err := getMusicSegment(targetPlatform, keyword) | ||
| if err != nil { | ||
| ctx.SendChain(message.Text("点歌失败:", err.Error())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ctx.SendChain(message.Text("点歌失败:", err.Error())) | |
| ctx.SendChain(message.Text("点歌失败:", err)) |
plugin/music/selecter.go
Outdated
| ) | ||
| // 平台映射:指令前缀 -> 平台名称 | ||
| var platformMap = map[string]string{ | ||
| "咪咕": "migu", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个中英互转没有意义,建议 key 直接放函数,如 "咪咕": getMiguMusic
plugin/music/selecter.go
Outdated
| // getMusicSegment 根据平台和关键词获取音乐消息段 | ||
| func getMusicSegment(platform, keyword string) (message.Segment, error) { | ||
| switch platform { | ||
| case "migu": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里就不需要了
plugin/music/selecter.go
Outdated
| // 传入 &song (指针) | ||
| playURL, err := migu.GetDownloadURL(&song) | ||
| if err != nil || playURL == "" { | ||
| return message.Segment{}, errors.New("获取咪咕播放链接失败:" + err.Error()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里用 errors.Wrap(),其他同理。
…t-Plugin into feature-music-20260121
No description provided.