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
128125ee
Commit
128125ee
authored
Apr 28, 2020
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support more poke messages
parent
3c98151f
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
111 additions
and
49 deletions
+111
-49
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/message/convension.kt
...in/kotlin/net/mamoe/mirai/qqandroid/message/convension.kt
+10
-2
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/data/proto/HummerCommelem.kt
...i/qqandroid/network/protocol/data/proto/HummerCommelem.kt
+39
-39
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/HummerMessage.kt
...Main/kotlin/net.mamoe.mirai/message/data/HummerMessage.kt
+62
-8
No files found.
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/message/convension.kt
View file @
128125ee
...
...
@@ -120,7 +120,9 @@ internal fun MessageChain.toRichTextElems(forGroup: Boolean, withGeneralFlags: B
businessType
=
it
.
type
,
pbElem
=
HummerCommelem
.
MsgElemInfoServtype2
(
pokeType
=
it
.
type
,
vaspokeId
=
it
.
id
vaspokeId
=
it
.
id
,
vaspokeMinver
=
"7.2.0"
,
vaspokeName
=
it
.
name
).
toByteArray
(
HummerCommelem
.
MsgElemInfoServtype2
.
serializer
())
)
)
...
...
@@ -383,7 +385,13 @@ internal fun List<ImMsgBody.Elem>.joinToMessageChain(groupIdOrZero: Long, bot: B
when
(
element
.
commonElem
.
serviceType
)
{
2
->
{
val
proto
=
element
.
commonElem
.
pbElem
.
loadAs
(
HummerCommelem
.
MsgElemInfoServtype2
.
serializer
())
list
.
add
(
PokeMessage
(
proto
.
pokeType
,
proto
.
vaspokeId
))
list
.
add
(
PokeMessage
(
proto
.
vaspokeName
.
takeIf
{
it
.
isNotEmpty
()
}
?:
PokeMessage
.
values
.
firstOrNull
{
it
.
id
==
proto
.
vaspokeId
&&
it
.
type
==
proto
.
pokeType
}
?.
name
.
orEmpty
(),
proto
.
pokeType
,
proto
.
vaspokeId
))
}
3
->
{
val
proto
=
element
.
commonElem
.
pbElem
.
loadAs
(
HummerCommelem
.
MsgElemInfoServtype3
.
serializer
())
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/data/proto/HummerCommelem.kt
View file @
128125ee
This diff is collapsed.
Click to expand it.
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/HummerMessage.kt
View file @
128125ee
...
...
@@ -46,9 +46,12 @@ sealed class HummerMessage : MessageContent {
@SinceMirai
(
"0.31.0"
)
@OptIn
(
MiraiInternalAPI
::
class
)
data class
PokeMessage
internal
constructor
(
@MiraiExperimentalAPI
(
"may change in future"
)
/**
* 仅 mirai, 显示的名称
*/
val
name
:
String
,
val
type
:
Int
,
@MiraiExperimentalAPI
(
"may change in future"
)
val
id
:
Int
)
:
HummerMessage
()
{
@Suppress
(
"DEPRECATION_ERROR"
,
"DEPRECATION"
,
"INVISIBLE_MEMBER"
,
"INVISIBLE_REFERENCE"
)
...
...
@@ -58,27 +61,78 @@ data class PokeMessage internal constructor(
/** 戳一戳 */
@JvmField
val
Poke
=
PokeMessage
(
1
,
-
1
)
val
Poke
=
PokeMessage
(
"戳一戳"
,
1
,
-
1
)
/** 比心 */
@JvmField
val
ShowLove
=
PokeMessage
(
2
,
-
1
)
val
ShowLove
=
PokeMessage
(
"比心"
,
2
,
-
1
)
/** 点赞 */
@JvmField
val
Like
=
PokeMessage
(
3
,
-
1
)
val
Like
=
PokeMessage
(
"点赞"
,
3
,
-
1
)
/** 心碎 */
@JvmField
val
Heartbroken
=
PokeMessage
(
4
,
-
1
)
val
Heartbroken
=
PokeMessage
(
"心碎"
,
4
,
-
1
)
/** 666 */
@JvmField
val
SixSixSix
=
PokeMessage
(
5
,
-
1
)
val
SixSixSix
=
PokeMessage
(
"666"
,
5
,
-
1
)
/** 放大招 */
@JvmField
val
FangDaZhao
=
PokeMessage
(
6
,
-
1
)
val
FangDaZhao
=
PokeMessage
(
"放大招"
,
6
,
-
1
)
/** 宝贝球 (SVIP) */
@JvmField
val
BaoBeiQiu
=
PokeMessage
(
"宝贝球"
,
126
,
2011
)
/** 玫瑰花 (SVIP) */
@JvmField
val
Rose
=
PokeMessage
(
"玫瑰花"
,
126
,
2007
)
/** 召唤术 (SVIP) */
@JvmField
val
ZhaoHuanShu
=
PokeMessage
(
"召唤术"
,
126
,
2006
)
/** 让你皮 (SVIP) */
@JvmField
val
RangNiPi
=
PokeMessage
(
"让你皮"
,
126
,
2009
)
/** 结印 (SVIP) */
@JvmField
val
JieYin
=
PokeMessage
(
"结印"
,
126
,
2005
)
/** 手雷 (SVIP) */
@JvmField
val
ShouLei
=
PokeMessage
(
"手雷"
,
126
,
2004
)
/** 勾引 */
@JvmField
val
GouYin
=
PokeMessage
(
"勾引"
,
126
,
2003
)
/** 抓一下 (SVIP) */
@JvmField
val
ZhuaYiXia
=
PokeMessage
(
"抓一下"
,
126
,
2001
)
/** 碎屏 (SVIP) */
@JvmField
val
SuiPing
=
PokeMessage
(
"碎屏"
,
126
,
2002
)
/** 敲门 (SVIP) */
@JvmField
val
QiaoMen
=
PokeMessage
(
"敲门"
,
126
,
2002
)
/**
* 所有类型数组
*/
@JvmStatic
val
values
:
Array
<
PokeMessage
>
=
arrayOf
(
Poke
,
ShowLove
,
Like
,
Heartbroken
,
SixSixSix
,
FangDaZhao
,
BaoBeiQiu
,
Rose
,
ZhaoHuanShu
,
RangNiPi
,
JieYin
,
ShouLei
,
GouYin
,
ZhuaYiXia
,
SuiPing
)
}
@OptIn
(
MiraiExperimentalAPI
::
class
)
...
...
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