@@ -20,14 +20,17 @@ import (
2020 "gopkg.in/yaml.v3"
2121
2222 "github.com/FloatTech/floatbox/binary"
23+ "github.com/FloatTech/floatbox/process"
2324 "github.com/FloatTech/zbputils/control"
2425 "github.com/FloatTech/zbputils/vevent"
2526 zero "github.com/wdvxdr1123/ZeroBot"
2627 "github.com/wdvxdr1123/ZeroBot/message"
2728)
2829
2930const (
30- StateKeyAgentHooked = zero .StateKeyPrefixKeep + "_chat_ag_hooked__"
31+ // StateKeyAgentHooked indicates that whether the agent log is in recording
32+ StateKeyAgentHooked = zero .StateKeyPrefixKeep + "_chat_ag_hooked__"
33+ // StateKeyAgentTriggered shows that this message has already triggered an agent run
3134 StateKeyAgentTriggered = zero .StateKeyPrefixKeep + "_chat_ag_triggered__"
3235)
3336
@@ -54,10 +57,15 @@ func init() {
5457 panic (err )
5558 }
5659 AgentCharConfig = & goba.Config {
57- Nickname : strings .Join (zero .BotConfig .NickName , "/" ),
58- Sex : agentcharcfg .Sex ,
59- Chars : agentcharcfg .Char ,
60+ Sex : agentcharcfg .Sex ,
61+ Chars : agentcharcfg .Char ,
6062 }
63+ go func () {
64+ process .GlobalInitMutex .Lock ()
65+ AgentCharConfig .Nickname = strings .Join (zero .BotConfig .NickName , "/" )
66+ logrus .Infoln ("[chat] 设置 agent 昵称:" , AgentCharConfig .Nickname )
67+ process .GlobalInitMutex .Unlock ()
68+ }()
6169}
6270
6371// AgentOf id is self_id
0 commit comments