Skip to content

Commit

Permalink
fix: 完善api
Browse files Browse the repository at this point in the history
  • Loading branch information
Redmomn committed Oct 7, 2024
1 parent 9de5b4c commit f53a215
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
13 changes: 6 additions & 7 deletions coolq/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,10 @@ func (bot *CQBot) CQGetGroupList(noCache bool, spec *onebot.Spec) global.MSG {
gs := make([]global.MSG, 0, len(grpInfos))
for _, g := range grpInfos {
gs = append(gs, global.MSG{
"group_id": spec.ConvertID(g.GroupUin),
"group_name": g.GroupName,
// TODO nt协议好像获取不到这俩信息
"group_create_time": 0,
"group_level": 0,
"group_id": spec.ConvertID(g.GroupUin),
"group_name": g.GroupName,
"group_create_time": g.GroupCreateTime,
"group_level": g.GroupLevel,
"max_member_count": g.MaxMember,
"member_count": g.MemberCount,
})
Expand All @@ -159,8 +158,8 @@ func (bot *CQBot) CQGetGroupInfo(groupID int64, noCache bool, spec *onebot.Spec)
return OK(global.MSG{
"group_id": spec.ConvertID(group.GroupUin),
"group_name": group.GroupName,
"group_create_time": 0,
"group_level": 0,
"group_create_time": group.GroupCreateTime,
"group_level": group.GroupLevel,
"max_member_count": group.MaxMember,
"member_count": group.MemberCount,
})
Expand Down
3 changes: 1 addition & 2 deletions coolq/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,8 +423,7 @@ func (bot *CQBot) friendRequestEvent(_ *client.QQClient, e *event2.NewFriendRequ
//}

func (bot *CQBot) groupInvitedEvent(_ *client.QQClient, e *event2.GroupInvite) {
// todo: 暂时先这样吧,群名不好拿
log.Infof("收到来自群 %v(%v) 内用户 %v(%v) 的加群邀请.", e.GroupUin, e.GroupUin, e.InvitorNick, e.InvitorUin)
log.Infof("收到来自群 %v(%v) 内用户 %v(%v) 的加群邀请.", e.GroupName, e.GroupUin, e.InvitorNick, e.InvitorUin)
flag := strconv.FormatInt(int64(e.RequestSeq), 10)
bot.dispatchEvent("request/group/invite", global.MSG{
"group_id": e.GroupUin,
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.20

require (
github.com/FloatTech/sqlite v1.6.3
github.com/LagrangeDev/LagrangeGo v0.0.0-20241006144137-4fc7fcb8caa1
github.com/LagrangeDev/LagrangeGo v0.1.1-0.20241007040125-9f9cfb87932a
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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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.0.0-20241006144137-4fc7fcb8caa1 h1:qbUK72LzMKXiAHaRVVfpJLxS5eQwQsYKyrHarOp7OQM=
github.com/LagrangeDev/LagrangeGo v0.0.0-20241006144137-4fc7fcb8caa1/go.mod h1:qK/l75YuMYdJWfPcxPhfjybJdXD4kzMFvcbKlvdAoa0=
github.com/LagrangeDev/LagrangeGo v0.1.1-0.20241007040125-9f9cfb87932a h1:e+FTzpaPBjT1L/+7QNxAlo9ili5YQa+fzQ2Q9LpCS+U=
github.com/LagrangeDev/LagrangeGo v0.1.1-0.20241007040125-9f9cfb87932a/go.mod h1:qK/l75YuMYdJWfPcxPhfjybJdXD4kzMFvcbKlvdAoa0=
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=
Expand Down

0 comments on commit f53a215

Please sign in to comment.