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
7d62db2e
Commit
7d62db2e
authored
Aug 31, 2020
by
Mrs4s
Committed by
GitHub
Aug 31, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #223 from F0ur/master
feat(api): make json response [] instead of null(empty list)
parents
e55b7d84
9b535835
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
coolq/api.go
coolq/api.go
+4
-4
No files found.
coolq/api.go
View file @
7d62db2e
...
...
@@ -25,7 +25,7 @@ func (bot *CQBot) CQGetLoginInfo() MSG {
// https://cqhttp.cc/docs/4.15/#/API?id=get_friend_list-%E8%8E%B7%E5%8F%96%E5%A5%BD%E5%8F%8B%E5%88%97%E8%A1%A8
func
(
bot
*
CQBot
)
CQGetFriendList
()
MSG
{
var
fs
[]
MSG
fs
:=
make
([]
MSG
,
0
)
for
_
,
f
:=
range
bot
.
Client
.
FriendList
{
fs
=
append
(
fs
,
MSG
{
"nickname"
:
f
.
Nickname
,
...
...
@@ -38,7 +38,7 @@ 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
func
(
bot
*
CQBot
)
CQGetGroupList
(
noCache
bool
)
MSG
{
var
gs
[]
MSG
gs
:=
make
([]
MSG
,
0
)
if
noCache
{
_
=
bot
.
Client
.
ReloadGroupList
()
}
...
...
@@ -73,7 +73,7 @@ func (bot *CQBot) CQGetGroupMemberList(groupId int64) MSG {
if
group
==
nil
{
return
Failed
(
100
)
}
var
members
[]
MSG
members
:=
make
([]
MSG
,
0
)
for
_
,
m
:=
range
group
.
Members
{
members
=
append
(
members
,
convertGroupMemberInfo
(
groupId
,
m
))
}
...
...
@@ -525,7 +525,7 @@ func (bot *CQBot) CQGetForwardMessage(resId string) MSG {
if
m
==
nil
{
return
Failed
(
100
)
}
var
r
[]
MSG
r
:=
make
([]
MSG
,
0
)
for
_
,
n
:=
range
m
.
Nodes
{
bot
.
checkMedia
(
n
.
Message
)
r
=
append
(
r
,
MSG
{
...
...
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