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
24dad3d6
Commit
24dad3d6
authored
Sep 05, 2020
by
scjtqs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
5024cc08
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
37 deletions
+60
-37
coolq/api.go
coolq/api.go
+6
-6
coolq/bot.go
coolq/bot.go
+0
-1
coolq/cqcode.go
coolq/cqcode.go
+54
-30
No files found.
coolq/api.go
View file @
24dad3d6
...
...
@@ -119,7 +119,7 @@ func (bot *CQBot) CQSendGroupMessage(groupId int64, i interface{}, autoEscape bo
}
if
m
,
ok
:=
i
.
(
gjson
.
Result
);
ok
{
if
m
.
Type
==
gjson
.
JSON
{
elem
:=
bot
.
ConvertObjectMessage
(
m
,
true
,
groupId
)
elem
:=
bot
.
ConvertObjectMessage
(
m
,
true
)
fixAt
(
elem
)
mid
:=
bot
.
SendGroupMessage
(
groupId
,
&
message
.
SendingMessage
{
Elements
:
elem
})
if
mid
==
-
1
{
...
...
@@ -144,7 +144,7 @@ func (bot *CQBot) CQSendGroupMessage(groupId int64, i interface{}, autoEscape bo
if
autoEscape
{
elem
=
append
(
elem
,
message
.
NewText
(
str
))
}
else
{
elem
=
bot
.
ConvertStringMessage
(
str
,
true
,
groupId
)
elem
=
bot
.
ConvertStringMessage
(
str
,
true
)
}
fixAt
(
elem
)
mid
:=
bot
.
SendGroupMessage
(
groupId
,
&
message
.
SendingMessage
{
Elements
:
elem
})
...
...
@@ -187,7 +187,7 @@ func (bot *CQBot) CQSendGroupForwardMessage(groupId int64, m gjson.Result) MSG {
}
return
m
[
"time"
]
.
(
int32
)
}(),
Message
:
bot
.
ConvertStringMessage
(
m
[
"message"
]
.
(
string
),
true
,
groupId
),
Message
:
bot
.
ConvertStringMessage
(
m
[
"message"
]
.
(
string
),
true
),
})
return
}
...
...
@@ -196,7 +196,7 @@ func (bot *CQBot) CQSendGroupForwardMessage(groupId int64, m gjson.Result) MSG {
}
uin
,
_
:=
strconv
.
ParseInt
(
e
.
Get
(
"data.uin"
)
.
Str
,
10
,
64
)
name
:=
e
.
Get
(
"data.name"
)
.
Str
content
:=
bot
.
ConvertObjectMessage
(
e
.
Get
(
"data.content"
),
true
,
groupId
)
content
:=
bot
.
ConvertObjectMessage
(
e
.
Get
(
"data.content"
),
true
)
if
uin
!=
0
&&
name
!=
""
&&
len
(
content
)
>
0
{
var
newElem
[]
message
.
IMessageElement
for
_
,
elem
:=
range
content
{
...
...
@@ -242,7 +242,7 @@ func (bot *CQBot) CQSendPrivateMessage(userId int64, i interface{}, autoEscape b
var
str
string
if
m
,
ok
:=
i
.
(
gjson
.
Result
);
ok
{
if
m
.
Type
==
gjson
.
JSON
{
elem
:=
bot
.
ConvertObjectMessage
(
m
,
true
,
userId
)
elem
:=
bot
.
ConvertObjectMessage
(
m
,
true
)
mid
:=
bot
.
SendPrivateMessage
(
userId
,
&
message
.
SendingMessage
{
Elements
:
elem
})
if
mid
==
-
1
{
return
Failed
(
100
)
...
...
@@ -265,7 +265,7 @@ func (bot *CQBot) CQSendPrivateMessage(userId int64, i interface{}, autoEscape b
if
autoEscape
{
elem
=
append
(
elem
,
message
.
NewText
(
str
))
}
else
{
elem
=
bot
.
ConvertStringMessage
(
str
,
false
,
userId
)
elem
=
bot
.
ConvertStringMessage
(
str
,
false
)
}
mid
:=
bot
.
SendPrivateMessage
(
userId
,
&
message
.
SendingMessage
{
Elements
:
elem
})
if
mid
==
-
1
{
...
...
coolq/bot.go
View file @
24dad3d6
...
...
@@ -259,4 +259,3 @@ func (m MSG) ToJson() string {
b
,
_
:=
json
.
Marshal
(
m
)
return
string
(
b
)
}
coolq/cqcode.go
View file @
24dad3d6
This diff is collapsed.
Click to expand it.
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