✏️ 缩小青云客匹配范围

This commit is contained in:
fumiama 2021-09-10 14:52:36 +08:00
parent e8503e97e3
commit 65a5b53b88

View File

@ -33,8 +33,8 @@ func init() { // 插件主体
Help: "青云客\n" + Help: "青云客\n" +
"- @Bot 任意文本(任意一句话回复)", "- @Bot 任意文本(任意一句话回复)",
}) })
// 回复 // 回复 匹配中文、英文、数字但不包括下划线等符号
engine.OnRegex("(^.{1,30}$)", zero.OnlyToMe).SetBlock(true).SetPriority(prio). engine.OnRegex("(^[\u4E00-\u9FA5A-Za-z0-9]{1,30}$)", zero.OnlyToMe).SetBlock(true).SetPriority(prio).
Handle(func(ctx *zero.Ctx) { Handle(func(ctx *zero.Ctx) {
if !bucket.Load(ctx.Event.UserID).Acquire() { if !bucket.Load(ctx.Event.UserID).Acquire() {
// 频繁触发,不回复 // 频繁触发,不回复