Skip to content

Commit

Permalink
fix: baidu 正则匹配 (#636)
Browse files Browse the repository at this point in the history
  • Loading branch information
anyanfei authored Mar 24, 2023
1 parent 1376803 commit 500dcaa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugin/baidu/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func init() { // 主函数
Help: "百度百科\n" +
"- 百度/百科[关键字]",
})
en.OnRegex(`^[百度|百科]\s*(.+)$`).SetBlock(true).Handle(func(ctx *zero.Ctx) {
en.OnRegex(`^百[度科]\s*(.+)$`).SetBlock(true).Handle(func(ctx *zero.Ctx) {
es, err := web.GetData(fmt.Sprintf(api, ctx.State["regex_matched"].([]string)[1])) // 将网站返回结果赋值
if err != nil {
ctx.SendChain(message.Text("出现错误捏:", err))
Expand Down

0 comments on commit 500dcaa

Please sign in to comment.