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
6ad0d689
Commit
6ad0d689
authored
Oct 25, 2020
by
Mrs4s
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feature get_group_system_msg.
parent
1b63a15b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
1 deletion
+22
-1
coolq/api.go
coolq/api.go
+9
-0
go.mod
go.mod
+1
-1
go.sum
go.sum
+2
-0
server/http.go
server/http.go
+7
-0
server/websocket.go
server/websocket.go
+3
-0
No files found.
coolq/api.go
View file @
6ad0d689
...
@@ -666,6 +666,15 @@ func (bot *CQBot) CQGetMessage(messageId int32) MSG {
...
@@ -666,6 +666,15 @@ func (bot *CQBot) CQGetMessage(messageId int32) MSG {
})
})
}
}
func
(
bot
*
CQBot
)
CQGetGroupSystemMessages
()
MSG
{
msg
,
err
:=
bot
.
Client
.
GetGroupSystemMessages
()
if
err
!=
nil
{
log
.
Warnf
(
"获取群系统消息失败: %v"
,
err
)
return
Failed
(
100
)
}
return
OK
(
msg
)
}
func
(
bot
*
CQBot
)
CQCanSendImage
()
MSG
{
func
(
bot
*
CQBot
)
CQCanSendImage
()
MSG
{
return
OK
(
MSG
{
"yes"
:
true
})
return
OK
(
MSG
{
"yes"
:
true
})
}
}
...
...
go.mod
View file @
6ad0d689
...
@@ -3,7 +3,7 @@ module github.com/Mrs4s/go-cqhttp
...
@@ -3,7 +3,7 @@ module github.com/Mrs4s/go-cqhttp
go 1.14
go 1.14
require (
require (
github.com/Mrs4s/MiraiGo v0.0.0-2020102
4092610-03d2bbf32a4d
github.com/Mrs4s/MiraiGo v0.0.0-2020102
5135955-5be0ad946177
github.com/gin-gonic/gin v1.6.3
github.com/gin-gonic/gin v1.6.3
github.com/gorilla/websocket v1.4.2
github.com/gorilla/websocket v1.4.2
github.com/guonaihong/gout v0.1.3
github.com/guonaihong/gout v0.1.3
...
...
go.sum
View file @
6ad0d689
...
@@ -8,6 +8,8 @@ github.com/Mrs4s/MiraiGo v0.0.0-20201017083749-517ddcd50b8d h1:f59SuqT0RVy6T9nAg
...
@@ -8,6 +8,8 @@ github.com/Mrs4s/MiraiGo v0.0.0-20201017083749-517ddcd50b8d h1:f59SuqT0RVy6T9nAg
github.com/Mrs4s/MiraiGo v0.0.0-20201017083749-517ddcd50b8d/go.mod h1:cwYPI2uq6nxNbx0nA6YuAKF1V5szSs6FPlGVLQvRUlo=
github.com/Mrs4s/MiraiGo v0.0.0-20201017083749-517ddcd50b8d/go.mod h1:cwYPI2uq6nxNbx0nA6YuAKF1V5szSs6FPlGVLQvRUlo=
github.com/Mrs4s/MiraiGo v0.0.0-20201024092610-03d2bbf32a4d h1:g200Tv/mkCy6oSFqfOzblMfa3D50iNhyG7IUUQWkb78=
github.com/Mrs4s/MiraiGo v0.0.0-20201024092610-03d2bbf32a4d h1:g200Tv/mkCy6oSFqfOzblMfa3D50iNhyG7IUUQWkb78=
github.com/Mrs4s/MiraiGo v0.0.0-20201024092610-03d2bbf32a4d/go.mod h1:cwYPI2uq6nxNbx0nA6YuAKF1V5szSs6FPlGVLQvRUlo=
github.com/Mrs4s/MiraiGo v0.0.0-20201024092610-03d2bbf32a4d/go.mod h1:cwYPI2uq6nxNbx0nA6YuAKF1V5szSs6FPlGVLQvRUlo=
github.com/Mrs4s/MiraiGo v0.0.0-20201025135955-5be0ad946177 h1:TcKqPWXKvOKW2O80rbswKYVLBB3Xas3+RvRInVMyBm8=
github.com/Mrs4s/MiraiGo v0.0.0-20201025135955-5be0ad946177/go.mod h1:cwYPI2uq6nxNbx0nA6YuAKF1V5szSs6FPlGVLQvRUlo=
github.com/bwmarrin/snowflake v0.3.0 h1:xm67bEhkKh6ij1790JB83OujPR5CzNe8QuQqAgISZN0=
github.com/bwmarrin/snowflake v0.3.0 h1:xm67bEhkKh6ij1790JB83OujPR5CzNe8QuQqAgISZN0=
github.com/bwmarrin/snowflake v0.3.0/go.mod h1:NdZxfVWX+oR6y2K0o6qAYv6gIOP9rjG0/E9WsDpxqwE=
github.com/bwmarrin/snowflake v0.3.0/go.mod h1:NdZxfVWX+oR6y2K0o6qAYv6gIOP9rjG0/E9WsDpxqwE=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
...
...
server/http.go
View file @
6ad0d689
...
@@ -318,6 +318,10 @@ func (s *httpServer) GetForwardMessage(c *gin.Context) {
...
@@ -318,6 +318,10 @@ func (s *httpServer) GetForwardMessage(c *gin.Context) {
c
.
JSON
(
200
,
s
.
bot
.
CQGetForwardMessage
(
resId
))
c
.
JSON
(
200
,
s
.
bot
.
CQGetForwardMessage
(
resId
))
}
}
func
(
s
*
httpServer
)
GetGroupSystemMessage
(
c
*
gin
.
Context
)
{
c
.
JSON
(
200
,
s
.
bot
.
CQGetGroupSystemMessages
())
}
func
(
s
*
httpServer
)
DeleteMessage
(
c
*
gin
.
Context
)
{
func
(
s
*
httpServer
)
DeleteMessage
(
c
*
gin
.
Context
)
{
mid
,
_
:=
strconv
.
ParseInt
(
getParam
(
c
,
"message_id"
),
10
,
32
)
mid
,
_
:=
strconv
.
ParseInt
(
getParam
(
c
,
"message_id"
),
10
,
32
)
c
.
JSON
(
200
,
s
.
bot
.
CQDeleteMessage
(
int32
(
mid
)))
c
.
JSON
(
200
,
s
.
bot
.
CQDeleteMessage
(
int32
(
mid
)))
...
@@ -505,6 +509,9 @@ var httpApi = map[string]func(s *httpServer, c *gin.Context){
...
@@ -505,6 +509,9 @@ var httpApi = map[string]func(s *httpServer, c *gin.Context){
"get_msg"
:
func
(
s
*
httpServer
,
c
*
gin
.
Context
)
{
"get_msg"
:
func
(
s
*
httpServer
,
c
*
gin
.
Context
)
{
s
.
GetMessage
(
c
)
s
.
GetMessage
(
c
)
},
},
"get_group_system_msg"
:
func
(
s
*
httpServer
,
c
*
gin
.
Context
)
{
s
.
GetGroupSystemMessage
(
c
)
},
"get_group_honor_info"
:
func
(
s
*
httpServer
,
c
*
gin
.
Context
)
{
"get_group_honor_info"
:
func
(
s
*
httpServer
,
c
*
gin
.
Context
)
{
s
.
GetGroupHonorInfo
(
c
)
s
.
GetGroupHonorInfo
(
c
)
},
},
...
...
server/websocket.go
View file @
6ad0d689
...
@@ -495,6 +495,9 @@ var wsApi = map[string]func(*coolq.CQBot, gjson.Result) coolq.MSG{
...
@@ -495,6 +495,9 @@ var wsApi = map[string]func(*coolq.CQBot, gjson.Result) coolq.MSG{
"get_version_info"
:
func
(
bot
*
coolq
.
CQBot
,
p
gjson
.
Result
)
coolq
.
MSG
{
"get_version_info"
:
func
(
bot
*
coolq
.
CQBot
,
p
gjson
.
Result
)
coolq
.
MSG
{
return
bot
.
CQGetVersionInfo
()
return
bot
.
CQGetVersionInfo
()
},
},
"get_group_system_msg"
:
func
(
bot
*
coolq
.
CQBot
,
p
gjson
.
Result
)
coolq
.
MSG
{
return
bot
.
CQGetGroupSystemMessages
()
},
"_get_vip_info"
:
func
(
bot
*
coolq
.
CQBot
,
p
gjson
.
Result
)
coolq
.
MSG
{
"_get_vip_info"
:
func
(
bot
*
coolq
.
CQBot
,
p
gjson
.
Result
)
coolq
.
MSG
{
return
bot
.
CQGetVipInfo
(
p
.
Get
(
"user_id"
)
.
Int
())
return
bot
.
CQGetVipInfo
(
p
.
Get
(
"user_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