(msg: Api.Message | string, n: number)
| 38 | } |
| 39 | |
| 40 | // 解析网易云链接获取ID |
| 41 | function extractSongId(text: string): string | null { |
| 42 | const idMatch = text.match(/(?:song\?id=|\/song\/)(\d+)/); |
| 43 | return idMatch ? idMatch[1] : null; |
| 44 | } |
| 45 | |
| 46 | async function ensureBotReady(msg: Api.Message) { |
| 47 | const client = msg.client!; |