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
86689cf5
Commit
86689cf5
authored
May 02, 2020
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjust filenames
parent
6ac1ea19
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
12 deletions
+14
-12
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/MessageChain.kt
...nMain/kotlin/net.mamoe.mirai/message/data/MessageChain.kt
+14
-12
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/MessageChainBuilder.kt
...otlin/net.mamoe.mirai/message/data/MessageChainBuilder.kt
+0
-0
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/MessageSourceBuilder.kt
...tlin/net.mamoe.mirai/message/data/MessageSourceBuilder.kt
+0
-0
No files found.
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/MessageChain.kt
View file @
86689cf5
...
...
@@ -10,9 +10,11 @@
@
file
:
JvmMultifileClass
@
file
:
JvmName
(
"MessageUtils"
)
@
file
:
Suppress
(
"unused"
,
"NOTHING_TO_INLINE"
)
@
file
:
OptIn
(
MiraiInternalAPI
::
class
)
package
net.mamoe.mirai.message.data
import
net.mamoe.mirai.JavaFriendlyAPI
import
net.mamoe.mirai.utils.MiraiExperimentalAPI
import
net.mamoe.mirai.utils.MiraiInternalAPI
import
net.mamoe.mirai.utils.SinceMirai
...
...
@@ -51,40 +53,40 @@ interface MessageChain : Message, Iterable<SingleMessage> {
* @param key 由各个类型消息的伴生对象持有. 如 [PlainText.Key]
* @throws NoSuchElementException 当找不到这个类型的 [Message] 时
*/
@Suppress
(
"INAPPLICABLE_JVM_NAME"
)
@Suppress
(
"
WRONG_MODIFIER_CONTAINING_DECLARATION"
,
"
INAPPLICABLE_JVM_NAME"
)
@JvmName
(
"first"
)
/* final */
operator
fun
<
M
:
Message
>
get
(
key
:
Message
.
Key
<
M
>):
M
=
first
(
key
)
final
operator
fun
<
M
:
Message
>
get
(
key
:
Message
.
Key
<
M
>):
M
=
first
(
key
)
/**
* 获取第一个类型为 [key] 的 [Message] 实例, 找不到则返回 `null`
*
* @param key 由各个类型消息的伴生对象持有. 如 [PlainText.Key]
*/
@Suppress
(
"INAPPLICABLE_JVM_NAME"
)
@Suppress
(
"
WRONG_MODIFIER_CONTAINING_DECLARATION"
,
"
INAPPLICABLE_JVM_NAME"
)
@JvmName
(
"firstOrNull"
)
/* final */
fun
<
M
:
Message
>
getOrNull
(
key
:
Message
.
Key
<
M
>):
M
?
=
firstOrNull
(
key
)
final
fun
<
M
:
Message
>
getOrNull
(
key
:
Message
.
Key
<
M
>):
M
?
=
firstOrNull
(
key
)
/**
* 遍历每一个有内容的消息, 即 [At], [AtAll], [PlainText], [Image], [Face]
, [XmlMessage], [QuoteReply].
* 遍历每一个有内容的消息, 即 [At], [AtAll], [PlainText], [Image], [Face]
等
* 仅供 `Java` 使用
*/
@Suppress
(
"FunctionName"
,
"INAPPLICABLE_JVM_NAME"
)
@Suppress
(
"
WRONG_MODIFIER_CONTAINING_DECLARATION"
,
"
FunctionName"
,
"INAPPLICABLE_JVM_NAME"
)
@JsName
(
"forEachContent"
)
@JvmName
(
"forEachContent"
)
@
MiraiInternal
API
f
un
`__forEachContent
for
Java__`
(
block
:
(
Message
)
->
Unit
)
{
@
JavaFriendly
API
f
inal
fun
__forEachContentForJava__
(
block
:
(
Message
)
->
Unit
)
{
this
.
forEachContent
(
block
)
}
/**
* 遍历每一个消息, 即 [MessageSource] [At], [AtAll], [PlainText], [Image], [
Face], [XmlMessage], [QuoteReply].
* 遍历每一个消息, 即 [MessageSource] [At], [AtAll], [PlainText], [Image], [
QuoteReply] 等
* 仅供 `Java` 使用
*/
@Suppress
(
"FunctionName"
,
"INAPPLICABLE_JVM_NAME"
)
@Suppress
(
"
WRONG_MODIFIER_CONTAINING_DECLARATION"
,
"
FunctionName"
,
"INAPPLICABLE_JVM_NAME"
)
@JsName
(
"forEach"
)
@JvmName
(
"forEach"
)
@
MiraiInternal
API
f
un
`__forEach
for
Java__`
(
block
:
(
Message
)
->
Unit
)
{
@
JavaFriendly
API
f
inal
fun
__forEachForJava__
(
block
:
(
Message
)
->
Unit
)
{
this
.
forEach
(
block
)
}
}
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/
b
uilder.kt
→
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/
MessageChainB
uilder.kt
View file @
86689cf5
File moved
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/
OfflineMessageSource
.kt
→
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/
MessageSourceBuilder
.kt
View file @
86689cf5
File moved
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