Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
G
go-cqhttp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
go-cqhttp
Commits
51696e80
Commit
51696e80
authored
Aug 20, 2020
by
Mrs4s
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
/get_group_list supported no_cache param.
parent
a6bcd964
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
3 deletions
+7
-3
coolq/api.go
coolq/api.go
+4
-1
server/http.go
server/http.go
+2
-1
server/websocket.go
server/websocket.go
+1
-1
No files found.
coolq/api.go
View file @
51696e80
...
@@ -34,8 +34,11 @@ func (bot *CQBot) CQGetFriendList() MSG {
...
@@ -34,8 +34,11 @@ func (bot *CQBot) CQGetFriendList() MSG {
}
}
// https://cqhttp.cc/docs/4.15/#/API?id=get_group_list-%E8%8E%B7%E5%8F%96%E7%BE%A4%E5%88%97%E8%A1%A8
// https://cqhttp.cc/docs/4.15/#/API?id=get_group_list-%E8%8E%B7%E5%8F%96%E7%BE%A4%E5%88%97%E8%A1%A8
func
(
bot
*
CQBot
)
CQGetGroupList
()
MSG
{
func
(
bot
*
CQBot
)
CQGetGroupList
(
noCache
bool
)
MSG
{
var
gs
[]
MSG
var
gs
[]
MSG
if
noCache
{
_
=
bot
.
Client
.
ReloadGroupList
()
}
for
_
,
g
:=
range
bot
.
Client
.
GroupList
{
for
_
,
g
:=
range
bot
.
Client
.
GroupList
{
gs
=
append
(
gs
,
MSG
{
gs
=
append
(
gs
,
MSG
{
"group_id"
:
g
.
Code
,
"group_id"
:
g
.
Code
,
...
...
server/http.go
View file @
51696e80
...
@@ -209,7 +209,8 @@ func (s *httpServer) GetFriendList(c *gin.Context) {
...
@@ -209,7 +209,8 @@ func (s *httpServer) GetFriendList(c *gin.Context) {
}
}
func
(
s
*
httpServer
)
GetGroupList
(
c
*
gin
.
Context
)
{
func
(
s
*
httpServer
)
GetGroupList
(
c
*
gin
.
Context
)
{
c
.
JSON
(
200
,
s
.
bot
.
CQGetGroupList
())
nc
:=
getParamOrDefault
(
c
,
"no_cache"
,
"false"
)
c
.
JSON
(
200
,
s
.
bot
.
CQGetGroupList
(
nc
==
"true"
))
}
}
func
(
s
*
httpServer
)
GetGroupInfo
(
c
*
gin
.
Context
)
{
func
(
s
*
httpServer
)
GetGroupInfo
(
c
*
gin
.
Context
)
{
...
...
server/websocket.go
View file @
51696e80
...
@@ -314,7 +314,7 @@ var wsApi = map[string]func(*coolq.CQBot, gjson.Result) coolq.MSG{
...
@@ -314,7 +314,7 @@ var wsApi = map[string]func(*coolq.CQBot, gjson.Result) coolq.MSG{
return
bot
.
CQGetFriendList
()
return
bot
.
CQGetFriendList
()
},
},
"get_group_list"
:
func
(
bot
*
coolq
.
CQBot
,
p
gjson
.
Result
)
coolq
.
MSG
{
"get_group_list"
:
func
(
bot
*
coolq
.
CQBot
,
p
gjson
.
Result
)
coolq
.
MSG
{
return
bot
.
CQGetGroupList
()
return
bot
.
CQGetGroupList
(
p
.
Get
(
"no_cache"
)
.
Bool
()
)
},
},
"get_group_info"
:
func
(
bot
*
coolq
.
CQBot
,
p
gjson
.
Result
)
coolq
.
MSG
{
"get_group_info"
:
func
(
bot
*
coolq
.
CQBot
,
p
gjson
.
Result
)
coolq
.
MSG
{
return
bot
.
CQGetGroupInfo
(
p
.
Get
(
"group_id"
)
.
Int
())
return
bot
.
CQGetGroupInfo
(
p
.
Get
(
"group_id"
)
.
Int
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment