From b2b98cc2d5e6c587a74f23f724b27f502a5e15ea Mon Sep 17 00:00:00 2001 From: Redmomn <109732988+Redmomn@users.noreply.github.com> Date: Thu, 28 Nov 2024 11:02:20 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E6=9B=B4=E5=A4=9A?= =?UTF-8?q?=E7=9A=84api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- coolq/api.go | 238 ++++++++++++++++++++-------------------- go.mod | 2 +- go.sum | 4 +- modules/api/api.go | 21 ++++ pkg/onebot/supported.go | 14 +++ 5 files changed, 156 insertions(+), 123 deletions(-) diff --git a/coolq/api.go b/coolq/api.go index f34b1ab42..24b7e46f2 100644 --- a/coolq/api.go +++ b/coolq/api.go @@ -7,6 +7,7 @@ import ( "encoding/json" "errors" "fmt" + "math" "strconv" "time" @@ -64,64 +65,61 @@ func (bot *CQBot) CQGetFriendList(spec *onebot.Spec) global.MSG { return OK(fs) } -// TODO 不支持的api,扔了先 // CQGetUnidirectionalFriendList 获取单向好友列表 // // @route(get_unidirectional_friend_list) -//func (bot *CQBot) CQGetUnidirectionalFriendList() global.MSG { -// list, err := bot.Client.GetUnidirectionalFriendList() -// if err != nil { -// log.Warnf("获取单向好友列表时出现错误: %v", err) -// return Failed(100, "API_ERROR", err.Error()) -// } -// fs := make([]global.MSG, 0, len(list)) -// for _, f := range list { -// fs = append(fs, global.MSG{ -// "nickname": f.Nickname, -// "user_id": f.Uin, -// "source": f.Source, -// }) -// } -// return OK(fs) -//} +func (bot *CQBot) CQGetUnidirectionalFriendList() global.MSG { + list, err := bot.Client.GetUnidirectionalFriendList() + if err != nil { + log.Warnf("获取单向好友列表时出现错误: %v", err) + return Failed(100, "API_ERROR", err.Error()) + } + fs := make([]global.MSG, 0, len(list)) + for _, f := range list { + fs = append(fs, global.MSG{ + "nickname": f.Nickname, + "user_id": f.Uin, + "source": f.Source, + }) + } + return OK(fs) +} -// TODO 不支持的api,扔了先 // CQDeleteUnidirectionalFriend 删除单向好友 // // @route(delete_unidirectional_friend) // @rename(uin->user_id) -//func (bot *CQBot) CQDeleteUnidirectionalFriend(uin int64) global.MSG { -// list, err := bot.Client.GetUnidirectionalFriendList() -// if err != nil { -// log.Warnf("获取单向好友列表时出现错误: %v", err) -// return Failed(100, "API_ERROR", err.Error()) -// } -// for _, f := range list { -// if f.Uin == uin { -// if err = bot.Client.DeleteUnidirectionalFriend(uin); err != nil { -// log.Warnf("删除单向好友时出现错误: %v", err) -// return Failed(100, "API_ERROR", err.Error()) -// } -// return OK(nil) -// } -// } -// return Failed(100, "FRIEND_NOT_FOUND", "好友不存在") -//} +func (bot *CQBot) CQDeleteUnidirectionalFriend(uin int64) global.MSG { + list, err := bot.Client.GetUnidirectionalFriendList() + if err != nil { + log.Warnf("获取单向好友列表时出现错误: %v", err) + return Failed(100, "API_ERROR", err.Error()) + } + for _, f := range list { + if f.Uin == uint32(uin) { + if err = bot.Client.DeleteUnidirectionalFriend(uint32(uin)); err != nil { + log.Warnf("删除单向好友时出现错误: %v", err) + return Failed(100, "API_ERROR", err.Error()) + } + return OK(nil) + } + } + return Failed(100, "FRIEND_NOT_FOUND", "好友不存在") +} -// TODO 不支持的api,扔了先 // CQDeleteFriend 删除好友 // @route(delete_friend) // @rename(uin->"[user_id\x2Cid].0") -//func (bot *CQBot) CQDeleteFriend(uin int64) global.MSG { -// if bot.Client.FindFriend(uin) == nil { -// return Failed(100, "FRIEND_NOT_FOUND", "好友不存在") -// } -// if err := bot.Client.DeleteFriend(uin); err != nil { -// log.Warnf("删除好友时出现错误: %v", err) -// return Failed(100, "DELETE_API_ERROR", err.Error()) -// } -// return OK(nil) -//} +func (bot *CQBot) CQDeleteFriend(uin int64, block bool) global.MSG { + if bot.Client.GetCachedFriendInfo(uint32(uin)) == nil { + return Failed(100, "FRIEND_NOT_FOUND", "好友不存在") + } + if err := bot.Client.DeleteFriend(uint32(uin), block); err != nil { + log.Warnf("删除好友时出现错误: %v", err) + return Failed(100, "DELETE_API_ERROR", err.Error()) + } + return OK(nil) +} // CQGetGroupList 获取群列表 // @@ -278,7 +276,7 @@ func (bot *CQBot) CQUploadGroupFile(groupID int64, file, name, folder string) gl log.Warnf("上传群文件 %v 失败: 文件不存在", file) return Failed(100, "FILE_NOT_FOUND", "文件不存在") } - if err := bot.Client.UploadGroupFile(uint32(groupID), file, name, utils.Ternary(folder == "", "/", folder)); err != nil { + if err := bot.Client.SendGroupFile(uint32(groupID), file, name, utils.Ternary(folder == "", "/", folder)); err != nil { log.Warnf("上传群 %v 文件 %v 失败: %v", groupID, file, err) return Failed(100, "FILE_SYSTEM_UPLOAD_API_ERROR", err.Error()) } @@ -293,7 +291,7 @@ func (bot *CQBot) CQUploadPrivateFile(userID int64, file, name string) global.MS log.Warnf("上传群文件 %v 失败: 文件不存在", file) return Failed(100, "FILE_NOT_FOUND", "文件不存在") } - if err := bot.Client.UploadPrivateFile(uint32(userID), file, name); err != nil { + if err := bot.Client.SendPrivateFile(uint32(userID), file, name); err != nil { log.Warnf("上传私聊 %v 文件 %v 失败: %+v", userID, file, err) return Failed(100, "FILE_SYSTEM_UPLOAD_API_ERROR", err.Error()) } @@ -618,7 +616,7 @@ func (bot *CQBot) CQSendPrivateMessage(userID int64, groupID int64, m gjson.Resu func (bot *CQBot) CQSetGroupCard(groupID, userID int64, card string) global.MSG { if g := bot.Client.GetCachedGroupInfo(uint32(groupID)); g != nil { if m := bot.Client.GetCachedMemberInfo(uint32(userID), uint32(groupID)); m != nil { - if err := bot.Client.GroupRenameMember(uint32(groupID), uint32(userID), card); err != nil { + if err := bot.Client.SetGroupMemberName(uint32(groupID), uint32(userID), card); err != nil { return Failed(100, "SET_CARD_FAILED", err.Error()) } @@ -636,7 +634,7 @@ func (bot *CQBot) CQSetGroupCard(groupID, userID int64, card string) global.MSG func (bot *CQBot) CQSetGroupSpecialTitle(groupID, userID int64, title string) global.MSG { if g := bot.Client.GetCachedGroupInfo(uint32(groupID)); g != nil { if m := bot.Client.GetCachedMemberInfo(uint32(userID), uint32(groupID)); m != nil { - if err := bot.Client.GroupSetSpecialTitle(uint32(groupID), uint32(userID), title); err != nil { + if err := bot.Client.SetGroupMemberSpecialTitle(uint32(groupID), uint32(userID), title); err != nil { return Failed(100, "SET_Title_FAILED", err.Error()) } return OK(nil) @@ -652,7 +650,7 @@ func (bot *CQBot) CQSetGroupSpecialTitle(groupID, userID int64, title string) gl // @rename(name->group_name) func (bot *CQBot) CQSetGroupName(groupID int64, name string) global.MSG { if g := bot.Client.GetCachedGroupInfo(uint32(groupID)); g != nil { - if err := bot.Client.GroupRename(uint32(groupID), name); err != nil { + if err := bot.Client.SetGroupName(uint32(groupID), name); err != nil { return Failed(100, "SET_NAME_FAILED", err.Error()) } return OK(nil) @@ -729,7 +727,7 @@ func (bot *CQBot) CQSetGroupKick(groupID int64, userID int64, block bool) global if m == nil { return Failed(100, "MEMBER_NOT_FOUND", "人员不存在") } - if err := bot.Client.GroupKickMember(uint32(groupID), uint32(userID), block); err != nil { + if err := bot.Client.KickGroupMember(uint32(groupID), uint32(userID), block); err != nil { return Failed(100, "NOT_MANAGEABLE", "机器人权限不足") } return OK(nil) @@ -748,7 +746,7 @@ func (bot *CQBot) CQSetGroupBan(groupID, userID int64, duration uint32) global.M if duration >= 2592000 { return Failed(100, "DURATION_IS_NOT_IN_RANGE", "非法的禁言时长") } - if err := bot.Client.GroupMuteMember(uint32(groupID), uint32(userID), duration); err != nil { + if err := bot.Client.SetGroupMemberMute(uint32(groupID), uint32(userID), duration); err != nil { return Failed(100, "NOT_MANAGEABLE", "机器人权限不足") } return OK(nil) @@ -764,7 +762,7 @@ func (bot *CQBot) CQSetGroupBan(groupID, userID int64, duration uint32) global.M // @default(enable=true) func (bot *CQBot) CQSetGroupWholeBan(groupID int64, enable bool) global.MSG { if g := bot.Client.GetCachedGroupInfo(uint32(groupID)); g != nil { - if err := bot.Client.GroupMuteGlobal(uint32(groupID), enable); err != nil { + if err := bot.Client.SetGroupGlobalMute(uint32(groupID), enable); err != nil { return Failed(100, "NOT_MANAGEABLE", "机器人权限不足") } return OK(nil) @@ -778,7 +776,7 @@ func (bot *CQBot) CQSetGroupWholeBan(groupID int64, enable bool) global.MSG { // @route(set_group_leave) func (bot *CQBot) CQSetGroupLeave(groupID int64) global.MSG { if g := bot.Client.GetCachedGroupInfo(uint32(groupID)); g != nil { - if err := bot.Client.GroupLeave(uint32(groupID)); err != nil { + if err := bot.Client.SetGroupLeave(uint32(groupID)); err != nil { return Failed(100, "反正是失败了.png", err.Error()) } return OK(nil) @@ -839,7 +837,7 @@ func (bot *CQBot) CQProcessGroupRequest(flag, subType, reason string, approve bo if subType == "add" { for _, req := range append(msgs.JoinRequests, filteredmsgs.JoinRequests...) { if strconv.FormatInt(int64(req.Sequence), 10) == flag { - if req.Checked() { + if req.Checked { log.Warnf("处理群系统消息失败: 无法操作已处理的消息.") return Failed(100, "FLAG_HAS_BEEN_CHECKED", "消息已被处理") } @@ -854,7 +852,7 @@ func (bot *CQBot) CQProcessGroupRequest(flag, subType, reason string, approve bo } else { for _, req := range append(msgs.InvitedRequests, filteredmsgs.InvitedRequests...) { if strconv.FormatInt(int64(req.Sequence), 10) == flag { - if req.Checked() { + if req.Checked { log.Warnf("处理群系统消息失败: 无法操作已处理的消息.") return Failed(100, "FLAG_HAS_BEEN_CHECKED", "消息已被处理") } @@ -918,8 +916,8 @@ func (bot *CQBot) CQSetGroupAdmin(groupID, userID int64, enable bool) global.MSG if m.Permission != entity.Owner { return Failed(100, "PERMISSION_DENIED", "或权限不足") } - if err := bot.Client.GroupSetAdmin(uint32(groupID), uint32(userID), enable); err != nil { - return Failed(100, "反正是失败了.png", err.Error()) + if err := bot.Client.SetGroupAdmin(uint32(groupID), uint32(userID), enable); err != nil { + return Failed(100, "UNKNOWN_ERROR", err.Error()) } return OK(nil) } @@ -1284,56 +1282,53 @@ func (bot *CQBot) CQGetMessage(messageID int32) global.MSG { return OK(m) } -// CQGetGroupSystemMessages 扩展API-获取群文件系统消息 +// CQGetGroupSystemMessages 扩展API-获取群系统消息 // // https://docs.go-cqhttp.org/api/#%E8%8E%B7%E5%8F%96%E7%BE%A4%E7%B3%BB%E7%BB%9F%E6%B6%88%E6%81%AF // @route(get_group_system_msg) -//func (bot *CQBot) CQGetGroupSystemMessages() global.MSG { -// msg, err := bot.Client.GetGroupSystemMessages() -// if err != nil { -// log.Warnf("获取群系统消息失败: %v", err) -// return Failed(100, "SYSTEM_MSG_API_ERROR", err.Error()) -// } -// return OK(msg) -//} +func (bot *CQBot) CQGetGroupSystemMessages() global.MSG { + msgs, err := bot.Client.GetGroupSystemMessages(false, 20) + if err != nil { + log.Warnf("获取群系统消息失败: %v", err) + return Failed(100, "SYSTEM_MSG_API_ERROR", err.Error()) + } + return OK(msgs) +} // CQGetGroupMessageHistory 获取群消息历史记录 // // https://docs.go-cqhttp.org/api/#%E8%8E%B7%E5%8F%96%E7%BE%A4%E6%B6%88%E6%81%AF%E5%8E%86%E5%8F%B2%E8%AE%B0%E5%BD%95 // @route(get_group_msg_history) // @rename(seq->message_seq) -//func (bot *CQBot) CQGetGroupMessageHistory(groupID int64, seq int64) global.MSG { -// if g, _ := bot.Client.GetCachedGroupInfo(uint32(groupID)); g == nil { -// return Failed(100, "GROUP_NOT_FOUND", "群聊不存在") -// } -// if seq == 0 { -// g, err := bot.Client.GetCachedGroupInfo(uint32(groupID)) -// if err != nil { -// return Failed(100, "GROUP_INFO_API_ERROR", err.Error()) -// } -// seq = g.LastMsgSeq -// } -// msg, err := bot.Client.GetGroupMessages(groupID, int64(math.Max(float64(seq-19), 1)), seq) -// if err != nil { -// log.Warnf("获取群历史消息失败: %v", err) -// return Failed(100, "MESSAGES_API_ERROR", err.Error()) -// } -// source := message.Source{ -// SourceType: message.SourcePrivate, -// PrimaryID: 0, -// } -// ms := make([]*event, 0, len(msg)) -// for _, m := range msg { -// bot.checkMedia(m.Elements, groupID) -// id := bot.InsertGroupMessage(m, source) -// t := bot.formatGroupMessage(m) -// t.Others["message_id"] = id -// ms = append(ms, t) -// } -// return OK(global.MSG{ -// "messages": ms, -// }) -//} +func (bot *CQBot) CQGetGroupMessageHistory(groupID int64, seq int64) global.MSG { + if g := bot.Client.GetCachedGroupInfo(uint32(groupID)); g == nil { + return Failed(100, "GROUP_NOT_FOUND", "群聊不存在") + } + if seq == 0 { + g := bot.Client.GetCachedGroupInfo(uint32(groupID)) + seq = int64(g.LastMsgSeq) + } + msg, err := bot.Client.GetGroupMessages(uint32(groupID), uint32(math.Max(float64(seq-19), 1)), uint32(seq)) + if err != nil { + log.Warnf("获取群历史消息失败: %v", err) + return Failed(100, "MESSAGES_API_ERROR", err.Error()) + } + source := message.Source{ + SourceType: message.SourcePrivate, + PrimaryID: 0, + } + ms := make([]*event, 0, len(msg)) + for _, m := range msg { + bot.checkMedia(m.Elements, source) + id := bot.InsertGroupMessage(m, source) + t := bot.formatGroupMessage(m) + t.Others["message_id"] = id + ms = append(ms, t) + } + return OK(global.MSG{ + "messages": ms, + }) +} // CQGetOnlineClients 扩展API-获取当前账号在线客户端列表 // @@ -1537,11 +1532,12 @@ func (bot *CQBot) CQGetEssenceMessageList(groupID int64) global.MSG { // // https://docs.go-cqhttp.org/api/#%E6%A3%80%E6%9F%A5%E9%93%BE%E6%8E%A5%E5%AE%89%E5%85%A8%E6%80%A7 // @route(check_url_safely) -//func (bot *CQBot) CQCheckURLSafely(url string) global.MSG { -// return OK(global.MSG{ -// "level": bot.Client.CheckUrlSafely(url), -// }) -//} +func (bot *CQBot) CQCheckURLSafely(url string) global.MSG { + level, _ := bot.Client.CheckURLSafely(url) + return OK(global.MSG{ + "level": level, + }) +} // CQGetVersionInfo 获取版本信息 // @@ -1613,24 +1609,26 @@ func (bot *CQBot) CQSendGroupSign(groupID int64) global.MSG { // return OK(nil) //} -// TODO 计划实现的api // CQMarkMessageAsRead 标记消息已读 // @route(mark_msg_as_read) // @rename(msg_id->message_id) -//func (bot *CQBot) CQMarkMessageAsRead(msgID int32) global.MSG { -// m, err := db.GetMessageByGlobalID(msgID) -// if err != nil { -// return Failed(100, "MSG_NOT_FOUND", "消息不存在") -// } -// switch o := m.(type) { -// case *db.StoredGroupMessage: -// bot.Client.MarkGroupMessageReaded(o.GroupCode, int64(o.Attribute.MessageSeq)) -// return OK(nil) -// case *db.StoredPrivateMessage: -// bot.Client.MarkPrivateMessageReaded(o.SessionUin, o.Attribute.Timestamp) -// } -// return OK(nil) -//} +func (bot *CQBot) CQMarkMessageAsRead(msgID int32) global.MSG { + m, err := db.GetMessageByGlobalID(msgID) + if err != nil { + return Failed(100, "MSG_NOT_FOUND", "消息不存在") + } + switch o := m.(type) { + case *db.StoredGroupMessage: + if bot.Client.MarkGroupMessageReaded(uint32(o.GroupCode), uint32(o.Attribute.MessageSeq)) != nil { + return Failed(100, "ACTION_FAILED", "标记群消息已读失败") + } + case *db.StoredPrivateMessage: + if bot.Client.MarkPrivateMessageReaded(uint32(o.SessionUin), uint32(o.Attribute.Timestamp), uint32(o.Attribute.MessageSeq)) != nil { + return Failed(100, "ACTION_FAILED", "标记私聊消息已读失败") + } + } + return OK(nil) +} // CQSetQQProfile 设置 QQ 资料 // diff --git a/go.mod b/go.mod index ecef00ee4..2ac65d21b 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/FloatTech/sqlite v1.6.3 - github.com/LagrangeDev/LagrangeGo v0.1.2-0.20241127060254-2b65455dd776 + github.com/LagrangeDev/LagrangeGo v0.1.2 github.com/Microsoft/go-winio v0.6.2-0.20230724192519-b29bbd58a65a github.com/RomiChan/syncx v0.0.0-20240418144900-b7402ffdebc7 github.com/RomiChan/websocket v1.4.3-0.20220227141055-9b2c6168c9c5 diff --git a/go.sum b/go.sum index fd3c75764..3a92f1a3d 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ github.com/FloatTech/sqlite v1.6.3 h1:MQkqBNlkPuCoKQQgoNLuTL/2Ci3tBTFAnVYBdD0Wy4 github.com/FloatTech/sqlite v1.6.3/go.mod h1:zFbHzRfB+CJ+VidfjuVbrcin3DAz283F7hF1hIeHzpY= github.com/FloatTech/ttl v0.0.0-20230307105452-d6f7b2b647d1 h1:g4pTnDJUW4VbJ9NvoRfUvdjDrHz/6QhfN/LoIIpICbo= github.com/FloatTech/ttl v0.0.0-20230307105452-d6f7b2b647d1/go.mod h1:fHZFWGquNXuHttu9dUYoKuNbm3dzLETnIOnm1muSfDs= -github.com/LagrangeDev/LagrangeGo v0.1.2-0.20241127060254-2b65455dd776 h1:hLOMBo1yB9gXp9JuK2CmPzGPrdpO+l3FW4W8R2IEshE= -github.com/LagrangeDev/LagrangeGo v0.1.2-0.20241127060254-2b65455dd776/go.mod h1:m7ydyvA8DKOg5c6iTFDfNtfIK9uhqXVJKRXl4mlGkTA= +github.com/LagrangeDev/LagrangeGo v0.1.2 h1:owH3gSZRTmW1qRuLsdkZsaBjyijKQUaJnLoui5XaTq0= +github.com/LagrangeDev/LagrangeGo v0.1.2/go.mod h1:m7ydyvA8DKOg5c6iTFDfNtfIK9uhqXVJKRXl4mlGkTA= github.com/Microsoft/go-winio v0.6.2-0.20230724192519-b29bbd58a65a h1:aU1703IHxupjzipvhu16qYKLMR03e+8WuNR+JMsKfGU= github.com/Microsoft/go-winio v0.6.2-0.20230724192519-b29bbd58a65a/go.mod h1:OZqLNXdYJHmx7aqq/T6wAdFEdoGm5nmIfC4kU7M8P8o= github.com/RomiChan/protobuf v0.1.1-0.20230204044148-2ed269a2e54d h1:/Xuj3fIiMY2ls1TwvPKmaqQrtJsPY+c9s+0lOScVHd8= diff --git a/modules/api/api.go b/modules/api/api.go index e7b724f44..bcda0853d 100644 --- a/modules/api/api.go +++ b/modules/api/api.go @@ -93,6 +93,9 @@ func (c *Caller) call(action string, spec *onebot.Spec, p Getter) global.MSG { p1 := p.Get("content").String() p2 := p.Get("image").String() return c.bot.CQSetGroupMemo(p0, p1, p2) + case "check_url_safely": + p0 := p.Get("url").String() + return c.bot.CQCheckURLSafely(p0) case "create_group_file_folder": p0 := p.Get("group_id").Int() p1 := p.Get("parent_id").String() @@ -101,6 +104,10 @@ func (c *Caller) call(action string, spec *onebot.Spec, p Getter) global.MSG { case "delete_essence_msg": p0 := int32(p.Get("message_id").Int()) return c.bot.CQDeleteEssenceMessage(p0) + case "delete_friend": + p0 := p.Get("[user_id,id].0").Int() + p1 := p.Get("block").Bool() + return c.bot.CQDeleteFriend(p0, p1) case "delete_group_file": p0 := p.Get("group_id").Int() p1 := p.Get("id").String() @@ -112,6 +119,9 @@ func (c *Caller) call(action string, spec *onebot.Spec, p Getter) global.MSG { case "delete_msg": p0 := int32(p.Get("message_id").Int()) return c.bot.CQDeleteMessage(p0) + case "delete_unidirectional_friend": + p0 := p.Get("user_id").Int() + return c.bot.CQDeleteUnidirectionalFriend(p0) case "download_file": p0 := p.Get("url").String() p1 := p.Get("headers") @@ -159,9 +169,15 @@ func (c *Caller) call(action string, spec *onebot.Spec, p Getter) global.MSG { p0 := p.Get("group_id").Int() p1 := p.Get("no_cache").Bool() return c.bot.CQGetGroupMemberList(p0, p1) + case "get_group_msg_history": + p0 := p.Get("group_id").Int() + p1 := p.Get("message_seq").Int() + return c.bot.CQGetGroupMessageHistory(p0, p1) case "get_group_root_files": p0 := p.Get("group_id").Int() return c.bot.CQGetGroupRootFiles(p0) + case "get_group_system_msg": + return c.bot.CQGetGroupSystemMessages() case "get_image": p0 := p.Get("file").String() return c.bot.CQGetImage(p0) @@ -172,6 +188,11 @@ func (c *Caller) call(action string, spec *onebot.Spec, p Getter) global.MSG { return c.bot.CQGetStatus(spec) case "get_supported_actions": return c.bot.CQGetSupportedActions(spec) + case "get_unidirectional_friend_list": + return c.bot.CQGetUnidirectionalFriendList() + case "mark_msg_as_read": + p0 := int32(p.Get("message_id").Int()) + return c.bot.CQMarkMessageAsRead(p0) case "reload_event_filter": p0 := p.Get("file").String() return c.bot.CQReloadEventFilter(p0) diff --git a/pkg/onebot/supported.go b/pkg/onebot/supported.go index 57a0f8704..3ceaa0e72 100644 --- a/pkg/onebot/supported.go +++ b/pkg/onebot/supported.go @@ -11,11 +11,14 @@ var supportedV11 = []string{ "_send_group_notice", "can_send_image", "can_send_record", + "check_url_safely", "create_group_file_folder", "delete_essence_msg", + "delete_friend", "delete_group_file", "delete_group_folder", "delete_msg", + "delete_unidirectional_friend", "download_file", "get_essence_msg_list", "get_forward_msg", @@ -29,14 +32,18 @@ var supportedV11 = []string{ "get_group_list", "get_group_member_info", "get_group_member_list", + "get_group_msg_history", "get_group_root_files", + "get_group_system_msg", "get_image", "get_login_info", "get_msg", "get_status", "get_stranger_info", "get_supported_actions", + "get_unidirectional_friend_list", "get_version_info", + "mark_msg_as_read", "reload_event_filter", "send_forward_msg", "send_group_forward_msg", @@ -67,11 +74,14 @@ var supportedV12 = []string{ "_del_group_notice", "_get_group_notice", "_send_group_notice", + "check_url_safely", "create_group_file_folder", "delete_essence_msg", + "delete_friend", "delete_group_file", "delete_group_folder", "delete_msg", + "delete_unidirectional_friend", "download_file", "get_essence_msg_list", "get_forward_msg", @@ -85,13 +95,17 @@ var supportedV12 = []string{ "get_group_list", "get_group_member_info", "get_group_member_list", + "get_group_msg_history", "get_group_root_files", + "get_group_system_msg", "get_image", "get_self_info", "get_msg", "get_status", "get_user_info", "get_supported_actions", + "get_unidirectional_friend_list", + "mark_msg_as_read", "reload_event_filter", "send_group_sign", "set_essence_msg",