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
69d5bbd7
Commit
69d5bbd7
authored
Mar 15, 2020
by
luo123
Committed by
Him188
Mar 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
group active data
parent
cae32512
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
165 additions
and
5 deletions
+165
-5
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/QQAndroidBot.kt
...mmonMain/kotlin/net/mamoe/mirai/qqandroid/QQAndroidBot.kt
+22
-5
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/data/GroupActiveData.kt
...commonMain/kotlin/net.mamoe.mirai/data/GroupActiveData.kt
+135
-0
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/lowLevelApi.kt
...core/src/commonMain/kotlin/net.mamoe.mirai/lowLevelApi.kt
+8
-0
No files found.
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/QQAndroidBot.kt
View file @
69d5bbd7
...
...
@@ -10,12 +10,9 @@
package
net.mamoe.mirai.qqandroid
import
io.ktor.client.HttpClient
import
io.ktor.client.request.*
import
io.ktor.client.request.forms.MultiPartFormDataContent
import
io.ktor.client.request.forms.formData
import
io.ktor.client.request.get
import
io.ktor.client.request.headers
import
io.ktor.client.request.post
import
io.ktor.client.request.url
import
io.ktor.client.statement.HttpResponse
import
kotlinx.coroutines.CoroutineName
import
kotlinx.coroutines.async
...
...
@@ -319,7 +316,7 @@ internal abstract class QQAndroidBotBase constructor(
}
}
@
OptIn
(
LowLevelAPI
::
class
)
@
LowLevelAPI
@MiraiExperimentalAPI
override
suspend
fun
_lowLevelGetAnnouncement
(
groupId
:
Long
,
fid
:
String
):
GroupAnnouncement
{
val
data
=
network
.
async
{
...
...
@@ -345,6 +342,26 @@ internal abstract class QQAndroidBotBase constructor(
return
json
.
parse
(
GroupAnnouncement
.
serializer
(),
rep
)
}
@LowLevelAPI
@MiraiExperimentalAPI
override
suspend
fun
_lowLevelGetGroupActiveData
(
groupId
:
Long
):
GroupActiveData
{
val
data
=
network
.
async
{
HttpClient
().
get
<
String
>
{
url
(
"https://qqweb.qq.com/c/activedata/get_mygroup_data"
)
parameter
(
"bkn"
,
bkn
)
parameter
(
"gc"
,
groupId
)
headers
{
append
(
"cookie"
,
"uin=o${selfQQ.id}; skey=${client.wLoginSigInfo.sKey.data.encodeToString()}; p_uin=o${selfQQ.id};"
)
}
}
}
val
rep
=
data
.
await
()
return
json
.
parse
(
GroupActiveData
.
serializer
(),
rep
)
}
override
suspend
fun
queryImageUrl
(
image
:
Image
):
String
=
when
(
image
)
{
is
OnlineFriendImageImpl
->
image
.
originUrl
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/data/GroupActiveData.kt
0 → 100644
View file @
69d5bbd7
package
net.mamoe.mirai.data
import
kotlinx.serialization.SerialName
import
kotlinx.serialization.Serializable
/**
* 群统计信息
*
*
* */
@Serializable
data class
GroupActiveData
(
@SerialName
(
"ec"
)
val
ec
:
Int
?
=
null
,
@SerialName
(
"em"
)
val
msg
:
String
?,
@SerialName
(
"errcode"
)
val
errCode
:
Int
?,
@SerialName
(
"ginfo"
)
val
info
:
Ginfo
?
=
null
,
@SerialName
(
"role"
)
val
role
:
Int
?
)
{
@Serializable
data class
Ginfo
(
@SerialName
(
"g_act_num"
)
val
actNum
:
List
<
GActNum
?
>?,
//发言人数列表
@SerialName
(
"g_createtime"
)
val
createTime
:
Int
?,
@SerialName
(
"g_exit_num"
)
val
exitNum
:
List
<
GExitNum
?
>?,
//退群人数列表
@SerialName
(
"g_join_num"
)
val
joinNum
:
List
<
GJoinNum
?
>?,
@SerialName
(
"g_mem_num"
)
val
memNum
:
List
<
GMemNum
?
>?,
//人数变化
@SerialName
(
"g_most_act"
)
val
mostAct
:
List
<
GMostAct
?
>?,
//发言排行
@SerialName
(
"g_sentences"
)
val
sentences
:
List
<
GSentence
?
>?,
@SerialName
(
"gc"
)
val
gc
:
Int
?,
@SerialName
(
"gn"
)
val
gn
:
String
?,
@SerialName
(
"gowner"
)
val
gowner
:
String
?,
@SerialName
(
"isEnd"
)
val
isEnd
:
Int
?
)
{
@Serializable
data class
GActNum
(
@SerialName
(
"date"
)
val
date
:
String
?,
@SerialName
(
"num"
)
val
num
:
Int
?
)
@Serializable
data class
GExitNum
(
@SerialName
(
"date"
)
val
date
:
String
?,
@SerialName
(
"num"
)
val
num
:
Int
?
)
@Serializable
data class
GJoinNum
(
@SerialName
(
"date"
)
val
date
:
String
?,
@SerialName
(
"num"
)
val
num
:
Int
?
)
@Serializable
data class
GMemNum
(
@SerialName
(
"date"
)
val
date
:
String
?,
@SerialName
(
"num"
)
val
num
:
Int
?
)
@Serializable
data class
GMostAct
(
@SerialName
(
"name"
)
val
name
:
String
?,
// 名称 不完整
@SerialName
(
"sentences_num"
)
val
sentencesNum
:
Int
?,
// 发言数
@SerialName
(
"sta"
)
val
sta
:
Int
?,
@SerialName
(
"uin"
)
val
uin
:
Long
?
)
@Serializable
data class
GSentence
(
@SerialName
(
"date"
)
val
date
:
String
?,
@SerialName
(
"num"
)
val
num
:
Int
?
)
}
}
\ No newline at end of file
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/lowLevelApi.kt
View file @
69d5bbd7
...
...
@@ -132,6 +132,14 @@ interface LowLevelBotAPIAccessor {
@MiraiExperimentalAPI
suspend
fun
_lowLevelGetAnnouncement
(
groupId
:
Long
,
fid
:
String
):
GroupAnnouncement
/**
* 获取群活跃信息
*
* */
@LowLevelAPI
@MiraiExperimentalAPI
suspend
fun
_lowLevelGetGroupActiveData
(
groupId
:
Long
):
GroupActiveData
}
/**
...
...
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