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
4ed33a9b
Commit
4ed33a9b
authored
Feb 07, 2020
by
ryoii
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
http-api support image message by send image id
parent
c8388e96
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
mirai-api-http/src/main/kotlin/net/mamoe/mirai/api/http/dto/MessageDTO.kt
...rc/main/kotlin/net/mamoe/mirai/api/http/dto/MessageDTO.kt
+3
-3
No files found.
mirai-api-http/src/main/kotlin/net/mamoe/mirai/api/http/dto/MessageDTO.kt
View file @
4ed33a9b
...
...
@@ -37,7 +37,7 @@ data class FaceDTO(val faceId: Int) : MessageDTO()
data class
PlainDTO
(
val
text
:
String
)
:
MessageDTO
()
@Serializable
@SerialName
(
"Image"
)
data class
ImageDTO
(
val
path
:
String
)
:
MessageDTO
()
data class
ImageDTO
(
val
imageId
:
String
)
:
MessageDTO
()
@Serializable
@SerialName
(
"Xml"
)
data class
XmlDTO
(
val
xml
:
String
)
:
MessageDTO
()
...
...
@@ -76,7 +76,7 @@ fun Message.toDTO() = when (this) {
is
At
->
AtDTO
(
target
,
display
)
is
Face
->
FaceDTO
(
id
.
value
.
toInt
())
is
PlainText
->
PlainDTO
(
stringValue
)
is
Image
->
ImageDTO
(
this
.
toString
()
)
is
Image
->
ImageDTO
(
imageId
)
is
XMLMessage
->
XmlDTO
(
stringValue
)
else
->
UnknownMessageDTO
(
"未知消息类型"
)
}
...
...
@@ -86,7 +86,7 @@ fun MessageDTO.toMessage() = when (this) {
is
AtDTO
->
At
(
target
,
display
)
is
FaceDTO
->
Face
(
FaceId
(
faceId
.
toUByte
()))
is
PlainDTO
->
PlainText
(
text
)
is
ImageDTO
->
PlainText
(
"[暂时不支持图片]"
)
is
ImageDTO
->
Image
(
imageId
)
is
XmlDTO
->
XMLMessage
(
xml
)
is
UnknownMessageDTO
->
PlainText
(
"assert cannot reach"
)
}
...
...
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