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
c619ee7f
Commit
c619ee7f
authored
Oct 13, 2020
by
Mrs4s
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix private rich msg.
parent
a53e549e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
2 deletions
+36
-2
coolq/bot.go
coolq/bot.go
+34
-0
server/apiAdmin.go
server/apiAdmin.go
+2
-2
No files found.
coolq/bot.go
View file @
c619ee7f
...
@@ -217,6 +217,40 @@ func (bot *CQBot) SendPrivateMessage(target int64, m *message.SendingMessage) in
...
@@ -217,6 +217,40 @@ func (bot *CQBot) SendPrivateMessage(target int64, m *message.SendingMessage) in
newElem
=
append
(
newElem
,
fm
)
newElem
=
append
(
newElem
,
fm
)
continue
continue
}
}
if
i
,
ok
:=
elem
.
(
*
QQMusicElement
);
ok
{
var
msgStyle
uint32
=
4
if
i
.
MusicUrl
==
""
{
msgStyle
=
0
// fix vip song
}
bot
.
Client
.
SendFriendRichMessage
(
target
,
100497308
,
1
,
msgStyle
,
client
.
RichClientInfo
{
Platform
:
1
,
SdkVersion
:
"0.0.0"
,
PackageName
:
"com.tencent.qqmusic"
,
Signature
:
"cbd27cd7c861227d013a25b2d10f0799"
,
},
&
message
.
RichMessage
{
Title
:
i
.
Title
,
Summary
:
i
.
Summary
,
Url
:
i
.
Url
,
PictureUrl
:
i
.
PictureUrl
,
MusicUrl
:
i
.
MusicUrl
,
})
return
0
}
if
i
,
ok
:=
elem
.
(
*
CloudMusicElement
);
ok
{
bot
.
Client
.
SendFriendRichMessage
(
target
,
100495085
,
1
,
4
,
client
.
RichClientInfo
{
Platform
:
1
,
SdkVersion
:
"0.0.0"
,
PackageName
:
"com.netease.cloudmusic"
,
Signature
:
"da6b069da1e2982db3e386233f68d76d"
,
},
&
message
.
RichMessage
{
Title
:
i
.
Title
,
Summary
:
i
.
Summary
,
Url
:
i
.
Url
,
PictureUrl
:
i
.
PictureUrl
,
MusicUrl
:
i
.
MusicUrl
,
})
return
0
}
newElem
=
append
(
newElem
,
elem
)
newElem
=
append
(
newElem
,
elem
)
}
}
m
.
Elements
=
newElem
m
.
Elements
=
newElem
...
...
server/apiAdmin.go
View file @
c619ee7f
...
@@ -136,7 +136,7 @@ func (s *webServer) Dologin() {
...
@@ -136,7 +136,7 @@ func (s *webServer) Dologin() {
continue
continue
case
client
.
SMSNeededError
:
case
client
.
SMSNeededError
:
log
.
Warnf
(
"账号已开启设备锁, 按下 Enter 向手机 %v 发送短信验证码."
,
rsp
.
SMSPhone
)
log
.
Warnf
(
"账号已开启设备锁, 按下 Enter 向手机 %v 发送短信验证码."
,
rsp
.
SMSPhone
)
_
,
_
=
s
.
Console
.
ReadString
(
'\n'
)
readLine
(
)
if
!
cli
.
RequestSMS
()
{
if
!
cli
.
RequestSMS
()
{
log
.
Warnf
(
"发送验证码失败,可能是请求过于频繁."
)
log
.
Warnf
(
"发送验证码失败,可能是请求过于频繁."
)
time
.
Sleep
(
time
.
Second
*
5
)
time
.
Sleep
(
time
.
Second
*
5
)
...
@@ -151,7 +151,7 @@ func (s *webServer) Dologin() {
...
@@ -151,7 +151,7 @@ func (s *webServer) Dologin() {
log
.
Warnf
(
"1. 向手机 %v 发送短信验证码"
,
rsp
.
SMSPhone
)
log
.
Warnf
(
"1. 向手机 %v 发送短信验证码"
,
rsp
.
SMSPhone
)
log
.
Warnf
(
"2. 使用手机QQ扫码验证."
)
log
.
Warnf
(
"2. 使用手机QQ扫码验证."
)
log
.
Warn
(
"请输入(1 - 2): "
)
log
.
Warn
(
"请输入(1 - 2): "
)
text
,
_
=
s
.
Console
.
ReadString
(
'\n'
)
text
=
readLine
(
)
if
strings
.
Contains
(
text
,
"1"
)
{
if
strings
.
Contains
(
text
,
"1"
)
{
if
!
cli
.
RequestSMS
()
{
if
!
cli
.
RequestSMS
()
{
log
.
Warnf
(
"发送验证码失败,可能是请求过于频繁."
)
log
.
Warnf
(
"发送验证码失败,可能是请求过于频繁."
)
...
...
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