22 lines
568 B
Go
22 lines
568 B
Go
package util
|
|
|
|
import (
|
|
"log"
|
|
"strconv"
|
|
|
|
"git.lxtend.com/qqbot/action"
|
|
"git.lxtend.com/qqbot/message"
|
|
)
|
|
|
|
func NewSelfNodeMessage(content ...any) *message.NodeMessage {
|
|
loginAccountInfo, err := action.GetLoginAccountInfo()
|
|
if err != nil {
|
|
log.Println("GetLoginAccountInfo error:", err)
|
|
return nil
|
|
}
|
|
if loginAccountInfo == nil {
|
|
return nil
|
|
}
|
|
return &message.NodeMessage{Type: message.TypeNode, Data: message.NodeMessageData{UserID: strconv.FormatInt(int64(loginAccountInfo.Data.UserID), 10), Nickname: loginAccountInfo.Data.Nickname, Content: content}}
|
|
}
|