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
1eff81d4
Commit
1eff81d4
authored
Apr 20, 2020
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use `first` on JVM
parent
1fae390f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/MessageChain.kt
...nMain/kotlin/net.mamoe.mirai/message/data/MessageChain.kt
+7
-0
No files found.
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/MessageChain.kt
View file @
1eff81d4
...
@@ -60,6 +60,7 @@ interface MessageChain : Message, Iterable<SingleMessage> {
...
@@ -60,6 +60,7 @@ interface MessageChain : Message, Iterable<SingleMessage> {
* @param key 由各个类型消息的伴生对象持有. 如 [PlainText.Key]
* @param key 由各个类型消息的伴生对象持有. 如 [PlainText.Key]
* @throws NoSuchElementException 当找不到这个类型的 [Message] 时
* @throws NoSuchElementException 当找不到这个类型的 [Message] 时
*/
*/
@JvmName
(
"first"
)
operator
fun
<
M
:
Message
>
get
(
key
:
Message
.
Key
<
M
>):
M
=
first
(
key
)
operator
fun
<
M
:
Message
>
get
(
key
:
Message
.
Key
<
M
>):
M
=
first
(
key
)
/**
/**
...
@@ -92,6 +93,12 @@ interface MessageChain : Message, Iterable<SingleMessage> {
...
@@ -92,6 +93,12 @@ interface MessageChain : Message, Iterable<SingleMessage> {
fun
`__forEach
for
Java__`
(
block
:
(
Message
)
->
Unit
)
{
fun
`__forEach
for
Java__`
(
block
:
(
Message
)
->
Unit
)
{
this
.
forEach
(
block
)
this
.
forEach
(
block
)
}
}
@Deprecated
(
"for binary compatibility"
,
level
=
DeprecationLevel
.
HIDDEN
)
@JvmSynthetic
@Suppress
(
"FunctionName"
,
"INAPPLICABLE_JVM_NAME"
)
@JvmName
(
"get"
)
fun
<
M
:
Message
>
get2
(
key
:
Message
.
Key
<
M
>):
M
=
first
(
key
)
}
}
// region accessors
// region accessors
...
...
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