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
6a631418
Commit
6a631418
authored
Apr 25, 2020
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add docs
parent
cd1dbf63
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/Message.kt
...commonMain/kotlin/net.mamoe.mirai/message/data/Message.kt
+5
-3
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/QuoteReply.kt
...monMain/kotlin/net.mamoe.mirai/message/data/QuoteReply.kt
+1
-1
No files found.
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/Message.kt
View file @
6a631418
...
...
@@ -73,7 +73,7 @@ import kotlin.jvm.JvmSynthetic
* @see Contact.sendMessage 发送消息
*/
@OptIn
(
MiraiInternalAPI
::
class
)
interface
Message
{
interface
Message
{
// must be interface. Don't consider any changes.
/**
* 类型 Key. 由伴生对象实现, 表示一个 [Message] 对象的类型.
*
...
...
@@ -123,12 +123,12 @@ interface Message {
*
* 各个 [SingleMessage] 的转换示例:
* [PlainText]: "Hello"
* [GroupImage]: "[mirai:image:{01E9451B-70ED-EAE3-B37C-101F1EEBF5B5}.
png
]"
* [GroupImage]: "[mirai:image:{01E9451B-70ED-EAE3-B37C-101F1EEBF5B5}.
mirai
]"
* [FriendImage]: "[mirai:image:/f8f1ab55-bf8e-4236-b55e-955848d7069f]"
* [PokeMessage]: "[mirai:poke:1,-1]"
* [MessageChain]: 无间隔地连接所有元素 (`joinToString("")`)
*
* @see contentToString
* @see contentToString
转为最接近官方格式的字符串
*/
override
fun
toString
():
String
...
...
@@ -142,6 +142,8 @@ interface Message {
* [Image]: "\[图片\]"
* [PokeMessage]: "\[戳一戳\]"
* [MessageChain]: 无间隔地连接所有元素 (`joinToString("", transformer=Message::contentToString)`)
*
* @see toString 得到包含 mirai 消息元素代码的, 易读的字符串
*/
@SinceMirai
(
"0.34.0"
)
fun
contentToString
():
String
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/QuoteReply.kt
View file @
6a631418
...
...
@@ -52,7 +52,7 @@ class QuoteReply(val source: MessageSource) : Message, MessageMetadata, Constrai
override
val
key
:
Message
.
Key
<
QuoteReply
>
get
()
=
Key
override
fun
toString
():
String
=
"[mirai:quote:${source.id}]"
override
fun
toString
():
String
=
"[mirai:quote:${source.id}
,${source.internalId}
]"
override
fun
contentToString
():
String
=
""
override
fun
equals
(
other
:
Any
?):
Boolean
=
other
is
QuoteReply
&&
other
.
source
==
this
.
source
override
fun
hashCode
():
Int
=
source
.
hashCode
()
...
...
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