mirror of
https://github.com/eryajf/chatgpt-dingtalk.git
synced 2025-10-07 09:01:03 +08:00
feat: 支持聊天记录存入以及查询的能力 (#158)
This commit is contained in:
@@ -68,13 +68,22 @@ type At struct {
|
||||
IsAtAll bool `json:"isAtAll"`
|
||||
}
|
||||
|
||||
// 获取用户标识,兼容当 SenderStaffId 字段为空的场景
|
||||
func (r ReceiveMsg) GetSenderIdentifier() string {
|
||||
if r.SenderStaffId != "" {
|
||||
return r.SenderStaffId
|
||||
} else {
|
||||
return r.SenderNick
|
||||
// 获取用户标识,兼容当 SenderStaffId 字段为空的场景,此处提供给发送消息是艾特使用
|
||||
func (r ReceiveMsg) GetSenderIdentifier() (uid string) {
|
||||
uid = r.SenderStaffId
|
||||
if uid == "" {
|
||||
uid = r.SenderNick
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// GetChatTitle 获取聊天的群名字,如果是私聊,则命名为 昵称_私聊
|
||||
func (r ReceiveMsg) GetChatTitle() (chatType string) {
|
||||
chatType = r.ConversationTitle
|
||||
if chatType == "" {
|
||||
chatType = r.SenderNick + "_私聊"
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// 发消息给钉钉
|
||||
|
Reference in New Issue
Block a user