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
4700c48d
Commit
4700c48d
authored
Mar 30, 2020
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unified toString
parent
f322af71
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
12 additions
and
11 deletions
+12
-11
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/At.kt
.../src/commonMain/kotlin/net.mamoe.mirai/message/data/At.kt
+1
-1
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/AtAll.kt
...c/commonMain/kotlin/net.mamoe.mirai/message/data/AtAll.kt
+2
-1
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/Face.kt
...rc/commonMain/kotlin/net.mamoe.mirai/message/data/Face.kt
+2
-2
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/HummerMessage.kt
...Main/kotlin/net.mamoe.mirai/message/data/HummerMessage.kt
+1
-1
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/Image.kt
...c/commonMain/kotlin/net.mamoe.mirai/message/data/Image.kt
+1
-1
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/QuoteReply.kt
...monMain/kotlin/net.mamoe.mirai/message/data/QuoteReply.kt
+1
-1
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/RichMessage.kt
...onMain/kotlin/net.mamoe.mirai/message/data/RichMessage.kt
+4
-4
No files found.
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/At.kt
View file @
4700c48d
...
@@ -39,7 +39,7 @@ private constructor(val target: Long, val display: String) :
...
@@ -39,7 +39,7 @@ private constructor(val target: Long, val display: String) :
*/
*/
constructor
(
member
:
Member
)
:
this
(
member
.
id
,
"@${member.nameCardOrNick}"
)
constructor
(
member
:
Member
)
:
this
(
member
.
id
,
"@${member.nameCardOrNick}"
)
override
fun
toString
():
String
=
display
override
fun
toString
():
String
=
"[mirai:at:$target]"
companion
object
Key
:
Message
.
Key
<
At
>
{
companion
object
Key
:
Message
.
Key
<
At
>
{
/**
/**
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/AtAll.kt
View file @
4700c48d
...
@@ -30,7 +30,8 @@ object AtAll :
...
@@ -30,7 +30,8 @@ object AtAll :
CharSequence
by
display
,
CharSequence
by
display
,
Comparable
<
String
>
by
display
{
Comparable
<
String
>
by
display
{
override
fun
toString
():
String
=
display
@Suppress
(
"SpellCheckingInspection"
)
override
fun
toString
():
String
=
"[mirai:atall]"
// 自动为消息补充 " "
// 自动为消息补充 " "
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/Face.kt
View file @
4700c48d
...
@@ -22,9 +22,9 @@ class Face private constructor(val id: Int, private val stringValue: String) :
...
@@ -22,9 +22,9 @@ class Face private constructor(val id: Int, private val stringValue: String) :
MessageContent
,
MessageContent
,
CharSequence
by
stringValue
,
Comparable
<
String
>
by
stringValue
{
CharSequence
by
stringValue
,
Comparable
<
String
>
by
stringValue
{
constructor
(
id
:
Int
)
:
this
(
id
,
"[mirai:face$id]"
)
constructor
(
id
:
Int
)
:
this
(
id
,
"[mirai:face
:
$id]"
)
override
fun
toString
():
String
=
"[mirai:face$id]"
override
fun
toString
():
String
=
stringValue
/**
/**
* @author LamGC
* @author LamGC
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/HummerMessage.kt
View file @
4700c48d
...
@@ -59,7 +59,7 @@ class PokeMessage @MiraiInternalAPI(message = "使用伴生对象中的常量")
...
@@ -59,7 +59,7 @@ class PokeMessage @MiraiInternalAPI(message = "使用伴生对象中的常量")
}
}
@OptIn
(
MiraiExperimentalAPI
::
class
)
@OptIn
(
MiraiExperimentalAPI
::
class
)
private
val
stringValue
=
"[mirai:
Poke($type, $id)
]"
private
val
stringValue
=
"[mirai:
poke:$type,$id
]"
override
fun
toString
():
String
=
stringValue
override
fun
toString
():
String
=
stringValue
override
val
length
:
Int
get
()
=
stringValue
.
length
override
val
length
:
Int
get
()
=
stringValue
.
length
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/Image.kt
View file @
4700c48d
...
@@ -63,7 +63,7 @@ abstract class AbstractImage internal constructor() : Image {
...
@@ -63,7 +63,7 @@ abstract class AbstractImage internal constructor() : Image {
private
var
_stringValue
:
String
?
=
null
private
var
_stringValue
:
String
?
=
null
get
()
{
get
()
{
return
field
?:
kotlin
.
run
{
return
field
?:
kotlin
.
run
{
field
=
"[mirai:$imageId]"
field
=
"[mirai:
image:
$imageId]"
field
field
}
}
}
}
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/QuoteReply.kt
View file @
4700c48d
...
@@ -33,7 +33,7 @@ open class QuoteReply
...
@@ -33,7 +33,7 @@ open class QuoteReply
@MiraiInternalAPI
constructor
(
val
source
:
MessageSource
)
:
Message
,
MessageMetadata
{
@MiraiInternalAPI
constructor
(
val
source
:
MessageSource
)
:
Message
,
MessageMetadata
{
companion
object
Key
:
Message
.
Key
<
QuoteReply
>
companion
object
Key
:
Message
.
Key
<
QuoteReply
>
final
override
fun
toString
():
String
=
""
final
override
fun
toString
():
String
=
"
[mirai:quote]
"
}
}
/**
/**
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/RichMessage.kt
View file @
4700c48d
...
@@ -119,7 +119,7 @@ class JsonMessage(override val content: String) : RichMessage {
...
@@ -119,7 +119,7 @@ class JsonMessage(override val content: String) : RichMessage {
companion
object
Key
:
Message
.
Key
<
JsonMessage
>
companion
object
Key
:
Message
.
Key
<
JsonMessage
>
// serviceId = 1
// serviceId = 1
override
fun
toString
():
String
=
content
override
fun
toString
():
String
=
"[mirai:json:$content]"
}
}
/**
/**
...
@@ -131,7 +131,7 @@ class LightApp constructor(override val content: String) : RichMessage {
...
@@ -131,7 +131,7 @@ class LightApp constructor(override val content: String) : RichMessage {
companion
object
Key
:
Message
.
Key
<
LightApp
>
companion
object
Key
:
Message
.
Key
<
LightApp
>
override
fun
toString
():
String
=
content
override
fun
toString
():
String
=
"[mirai:app:$content]"
}
}
...
@@ -147,7 +147,7 @@ class XmlMessage constructor(override val content: String) : RichMessage {
...
@@ -147,7 +147,7 @@ class XmlMessage constructor(override val content: String) : RichMessage {
// override val serviceId: Int get() = 60
// override val serviceId: Int get() = 60
override
fun
toString
():
String
=
content
override
fun
toString
():
String
=
"[mirai:xml:$content]"
}
}
/**
/**
...
@@ -160,7 +160,7 @@ class LongMessage(override val content: String, val resId: String) : RichMessage
...
@@ -160,7 +160,7 @@ class LongMessage(override val content: String, val resId: String) : RichMessage
companion
object
Key
:
Message
.
Key
<
XmlMessage
>
companion
object
Key
:
Message
.
Key
<
XmlMessage
>
// serviceId = 35
// serviceId = 35
override
fun
toString
():
String
=
content
override
fun
toString
():
String
=
"[mirai:long:$content]"
}
}
/*
/*
...
...
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