feat: 添加获取登录账户信息的功能,并更新相关数据结构和常量
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package help
|
||||
|
||||
import (
|
||||
"log"
|
||||
"strconv"
|
||||
|
||||
"git.lxtend.com/qqbot/action"
|
||||
"git.lxtend.com/qqbot/constants"
|
||||
"git.lxtend.com/qqbot/handler"
|
||||
@@ -32,8 +35,16 @@ func help(msg model.Message) *model.Reply {
|
||||
textMsg := message.NewTextMessage()
|
||||
textMsg.Data.Text = helpInfo
|
||||
nodeMsg := message.NewNodeMessage()
|
||||
nodeMsg.Data.UserID = "123456789"
|
||||
nodeMsg.Data.Nickname = "test"
|
||||
loginAccountInfo, err := action.ActionManager.GetLoginAccountInfo()
|
||||
if err != nil {
|
||||
log.Println("GetLoginAccountInfo error:", err)
|
||||
return nil
|
||||
}
|
||||
if loginAccountInfo == nil {
|
||||
return nil
|
||||
}
|
||||
nodeMsg.Data.UserID = strconv.FormatInt(int64(loginAccountInfo.Data.UserID), 10)
|
||||
nodeMsg.Data.Nickname = loginAccountInfo.Data.Nickname
|
||||
nodeMsg.Data.Content = []any{&textMsg}
|
||||
action.ActionManager.SendForward(&model.Reply{
|
||||
ReplyMsg: []any{&nodeMsg},
|
||||
|
||||
Reference in New Issue
Block a user