Skip to content

Conversation

@Lianzy-Baimiao
Copy link

增加 BV码 识别的方式

handleLive(ctx)
}
})
en.OnRegex(`^([BV][A-Za-z0-9]+)`).SetBlock(true).Limit(limit.LimitByGroup).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
en.OnRegex(`^([BV][A-Za-z0-9]+)`).SetBlock(true).Limit(limit.LimitByGroup).
en.OnRegex(`(BV[A-Za-z0-9]{10,})`).SetBlock(true).Limit(limit.LimitByGroup).

})
en.OnRegex(`^([BV][A-Za-z0-9]+)`).SetBlock(true).Limit(limit.LimitByGroup).
Handle(func(ctx *zero.Ctx) {
u := ctx.State["regex_matched"].([]string)[0]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

直接用ctx.State["regex_matched"].([]string)[1]拿到匹配的BV号,一次拼接为完整链接。

@fumiama
Copy link
Member

fumiama commented Sep 26, 2025

close due to repo package change

@fumiama fumiama closed this Sep 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants