mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-19 22:00:11 +08:00
fix: baidu 正则匹配 (#636)
This commit is contained in:
parent
1376803b07
commit
500dcaa9ed
@ -30,7 +30,7 @@ func init() { // 主函数
|
|||||||
Help: "百度百科\n" +
|
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])) // 将网站返回结果赋值
|
es, err := web.GetData(fmt.Sprintf(api, ctx.State["regex_matched"].([]string)[1])) // 将网站返回结果赋值
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ctx.SendChain(message.Text("出现错误捏:", err))
|
ctx.SendChain(message.Text("出现错误捏:", err))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user