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
69675aa0
Commit
69675aa0
authored
Aug 12, 2020
by
Mrs4s
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix #75.
parent
782a3e2a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
server/http.go
server/http.go
+8
-0
server/websocket.go
server/websocket.go
+6
-0
No files found.
server/http.go
View file @
69675aa0
...
@@ -229,6 +229,14 @@ func (s *httpServer) GetGroupMemberInfo(c *gin.Context) {
...
@@ -229,6 +229,14 @@ func (s *httpServer) GetGroupMemberInfo(c *gin.Context) {
}
}
func
(
s
*
httpServer
)
SendMessage
(
c
*
gin
.
Context
)
{
func
(
s
*
httpServer
)
SendMessage
(
c
*
gin
.
Context
)
{
if
getParam
(
c
,
"message_type"
)
==
"private"
{
s
.
SendPrivateMessage
(
c
)
return
}
if
getParam
(
c
,
"message_type"
)
==
"group"
{
s
.
SendGroupMessage
(
c
)
return
}
if
getParam
(
c
,
"group_id"
)
!=
""
{
if
getParam
(
c
,
"group_id"
)
!=
""
{
s
.
SendGroupMessage
(
c
)
s
.
SendGroupMessage
(
c
)
return
return
...
...
server/websocket.go
View file @
69675aa0
...
@@ -331,6 +331,12 @@ var wsApi = map[string]func(*coolq.CQBot, gjson.Result) coolq.MSG{
...
@@ -331,6 +331,12 @@ var wsApi = map[string]func(*coolq.CQBot, gjson.Result) coolq.MSG{
)
)
},
},
"send_msg"
:
func
(
bot
*
coolq
.
CQBot
,
p
gjson
.
Result
)
coolq
.
MSG
{
"send_msg"
:
func
(
bot
*
coolq
.
CQBot
,
p
gjson
.
Result
)
coolq
.
MSG
{
if
p
.
Get
(
"message_type"
)
.
Str
==
"private"
{
return
bot
.
CQSendPrivateMessage
(
p
.
Get
(
"user_id"
)
.
Int
(),
p
.
Get
(
"message"
))
}
if
p
.
Get
(
"message_type"
)
.
Str
==
"group"
{
return
bot
.
CQSendGroupMessage
(
p
.
Get
(
"group_id"
)
.
Int
(),
p
.
Get
(
"message"
))
}
if
p
.
Get
(
"group_id"
)
.
Int
()
!=
0
{
if
p
.
Get
(
"group_id"
)
.
Int
()
!=
0
{
return
bot
.
CQSendGroupMessage
(
p
.
Get
(
"group_id"
)
.
Int
(),
p
.
Get
(
"message"
))
return
bot
.
CQSendGroupMessage
(
p
.
Get
(
"group_id"
)
.
Int
(),
p
.
Get
(
"message"
))
}
}
...
...
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