Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
Mirai
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
MyCard
Mirai
Commits
07d9365d
Commit
07d9365d
authored
Jul 04, 2020
by
mzdluo123
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: crash when get GroupActiveData
parent
2eac5ab6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
33 deletions
+56
-33
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/QQAndroidBot.common.kt
...n/kotlin/net/mamoe/mirai/qqandroid/QQAndroidBot.common.kt
+5
-3
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/data/GroupActiveData.kt
...commonMain/kotlin/net.mamoe.mirai/data/GroupActiveData.kt
+26
-26
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/lowLevelApi.kt
...core/src/commonMain/kotlin/net.mamoe.mirai/lowLevelApi.kt
+25
-4
No files found.
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/QQAndroidBot.common.kt
View file @
07d9365d
...
...
@@ -144,7 +144,7 @@ internal class QQAndroidBot constructor(
@Suppress
(
"DuplicatedCode"
)
@OptIn
(
LowLevelAPI
::
class
)
override
suspend
fun
rejectMemberJoinRequest
(
event
:
MemberJoinRequestEvent
,
blackList
:
Boolean
)
{
rejectMemberJoinRequest
(
event
,
blackList
,
""
)
rejectMemberJoinRequest
(
event
,
blackList
,
""
)
}
@Suppress
(
"DuplicatedCode"
)
...
...
@@ -585,13 +585,15 @@ internal abstract class QQAndroidBotBase constructor(
@LowLevelAPI
@MiraiExperimentalAPI
override
suspend
fun
_lowLevelGetGroupActiveData
(
groupId
:
Long
):
GroupActiveData
{
override
suspend
fun
_lowLevelGetGroupActiveData
(
groupId
:
Long
,
page
:
Int
):
GroupActiveData
{
val
data
=
network
.
async
{
HttpClient
().
get
<
String
>
{
url
(
"https://qqweb.qq.com/c/activedata/get_mygroup_data"
)
parameter
(
"bkn"
,
bkn
)
parameter
(
"gc"
,
groupId
)
if
(
page
!=
-
1
)
{
parameter
(
"page"
,
page
)
}
headers
{
append
(
"cookie"
,
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/data/GroupActiveData.kt
View file @
07d9365d
...
...
@@ -26,109 +26,109 @@ data class GroupActiveData(
val
info
:
GInfo
?
=
null
,
@SerialName
(
"role"
)
val
role
:
Int
?
val
role
:
Int
?
=
0
)
{
@Serializable
data class
GInfo
(
@SerialName
(
"g_act_num"
)
val
actNum
:
List
<
GActNum
?
>?,
//发言人数列表
val
actNum
:
List
<
GActNum
?
>?
=
null
,
//发言人数列表
@SerialName
(
"g_createtime"
)
val
createTime
:
Int
?,
val
createTime
:
Int
?
=
0
,
@SerialName
(
"g_exit_num"
)
val
exitNum
:
List
<
GExitNum
?
>?,
//退群人数列表
val
exitNum
:
List
<
GExitNum
?
>?
=
null
,
//退群人数列表
@SerialName
(
"g_join_num"
)
val
joinNum
:
List
<
GJoinNum
?
>?,
val
joinNum
:
List
<
GJoinNum
?
>?
=
null
,
@SerialName
(
"g_mem_num"
)
val
memNum
:
List
<
GMemNum
?
>?,
//人数变化
val
memNum
:
List
<
GMemNum
?
>?
=
null
,
//人数变化
@SerialName
(
"g_most_act"
)
val
mostAct
:
List
<
GMostAct
?
>?,
//发言排行
val
mostAct
:
List
<
GMostAct
?
>?
=
null
,
//发言排行
@SerialName
(
"g_sentences"
)
val
sentences
:
List
<
GSentence
?
>?,
val
sentences
:
List
<
GSentence
?
>?
=
null
,
@SerialName
(
"gc"
)
val
gc
:
Int
?,
val
gc
:
Int
?
=
null
,
@SerialName
(
"gn"
)
val
gn
:
String
?,
val
gn
:
String
?
=
null
,
@SerialName
(
"gowner"
)
val
gowner
:
String
?,
val
gowner
:
String
?
=
null
,
@SerialName
(
"isEnd"
)
val
isEnd
:
Int
?
val
isEnd
:
Int
?
=
null
)
{
@Serializable
data class
GActNum
(
@SerialName
(
"date"
)
val
date
:
String
?,
val
date
:
String
?
=
null
,
@SerialName
(
"num"
)
val
num
:
Int
?
val
num
:
Int
?
=
0
)
@Serializable
data class
GExitNum
(
@SerialName
(
"date"
)
val
date
:
String
?,
val
date
:
String
?
=
null
,
@SerialName
(
"num"
)
val
num
:
Int
?
val
num
:
Int
?
=
0
)
@Serializable
data class
GJoinNum
(
@SerialName
(
"date"
)
val
date
:
String
?,
val
date
:
String
?
=
null
,
@SerialName
(
"num"
)
val
num
:
Int
?
val
num
:
Int
?
=
0
)
@Serializable
data class
GMemNum
(
@SerialName
(
"date"
)
val
date
:
String
?,
val
date
:
String
?
=
null
,
@SerialName
(
"num"
)
val
num
:
Int
?
val
num
:
Int
?
=
0
)
@Serializable
data class
GMostAct
(
@SerialName
(
"name"
)
val
name
:
String
?,
// 名称 不完整
val
name
:
String
?
=
null
,
// 名称 不完整
@SerialName
(
"sentences_num"
)
val
sentencesNum
:
Int
?,
// 发言数
val
sentencesNum
:
Int
?
=
0
,
// 发言数
@SerialName
(
"sta"
)
val
sta
:
Int
?,
val
sta
:
Int
?
=
0
,
@SerialName
(
"uin"
)
val
uin
:
Long
?
val
uin
:
Long
?
=
0
)
@Serializable
data class
GSentence
(
@SerialName
(
"date"
)
val
date
:
String
?,
val
date
:
String
?
=
null
,
@SerialName
(
"num"
)
val
num
:
Int
?
val
num
:
Int
?
=
0
)
}
}
\ No newline at end of file
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/lowLevelApi.kt
View file @
07d9365d
...
...
@@ -112,10 +112,12 @@ interface LowLevelBotAPIAccessor {
/**
* 获取群活跃信息
* 不传page可得到趋势图
* page从0开始传入可以得到发言列表
*/
@LowLevelAPI
@MiraiExperimentalAPI
suspend
fun
_lowLevelGetGroupActiveData
(
groupId
:
Long
):
GroupActiveData
suspend
fun
_lowLevelGetGroupActiveData
(
groupId
:
Long
,
page
:
Int
=
-
1
):
GroupActiveData
/**
...
...
@@ -123,19 +125,38 @@ interface LowLevelBotAPIAccessor {
*/
@LowLevelAPI
@MiraiExperimentalAPI
suspend
fun
_lowLevelSolveNewFriendRequestEvent
(
eventId
:
Long
,
fromId
:
Long
,
fromNick
:
String
,
accept
:
Boolean
,
blackList
:
Boolean
)
suspend
fun
_lowLevelSolveNewFriendRequestEvent
(
eventId
:
Long
,
fromId
:
Long
,
fromNick
:
String
,
accept
:
Boolean
,
blackList
:
Boolean
)
/**
* 处理被邀请加入一个群请求事件
*/
@LowLevelAPI
@MiraiExperimentalAPI
suspend
fun
_lowLevelSolveBotInvitedJoinGroupRequestEvent
(
eventId
:
Long
,
invitorId
:
Long
,
groupId
:
Long
,
accept
:
Boolean
)
suspend
fun
_lowLevelSolveBotInvitedJoinGroupRequestEvent
(
eventId
:
Long
,
invitorId
:
Long
,
groupId
:
Long
,
accept
:
Boolean
)
/**
* 处理账号请求加入群事件
*/
@LowLevelAPI
@MiraiExperimentalAPI
suspend
fun
_lowLevelSolveMemberJoinRequestEvent
(
eventId
:
Long
,
fromId
:
Long
,
fromNick
:
String
,
groupId
:
Long
,
accept
:
Boolean
?,
blackList
:
Boolean
,
message
:
String
=
""
)
suspend
fun
_lowLevelSolveMemberJoinRequestEvent
(
eventId
:
Long
,
fromId
:
Long
,
fromNick
:
String
,
groupId
:
Long
,
accept
:
Boolean
?,
blackList
:
Boolean
,
message
:
String
=
""
)
}
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