mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-19 22:00:11 +08:00
🐛 修复直接使用昵称无法触发回复的问题
This commit is contained in:
parent
35cd742f03
commit
b6ff8865a3
@ -75,8 +75,6 @@ func GetName() func(ctx *zero.Ctx) bool {
|
|||||||
qq = ctx.Event.UserID
|
qq = ctx.Event.UserID
|
||||||
case arr[0].Type == "at":
|
case arr[0].Type == "at":
|
||||||
qq, _ = strconv.ParseInt(arr[0].Data["qq"], 10, 64)
|
qq, _ = strconv.ParseInt(arr[0].Data["qq"], 10, 64)
|
||||||
default:
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
// 获取名字
|
// 获取名字
|
||||||
info := ctx.GetGroupMemberInfo(ctx.Event.GroupID, qq, false)
|
info := ctx.GetGroupMemberInfo(ctx.Event.GroupID, qq, false)
|
||||||
@ -89,9 +87,9 @@ func GetName() func(ctx *zero.Ctx) bool {
|
|||||||
name = info.Get("title").Str
|
name = info.Get("title").Str
|
||||||
}
|
}
|
||||||
temp := []rune(name)
|
temp := []rune(name)
|
||||||
if len(temp) > 10 {
|
if len(temp) > 20 {
|
||||||
// 防止超长名字
|
// 防止超长名字
|
||||||
temp = temp[:10]
|
temp = temp[:20]
|
||||||
}
|
}
|
||||||
name = string(temp)
|
name = string(temp)
|
||||||
ctx.State["name"] = name
|
ctx.State["name"] = name
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user