mirror of
https://github.com/whitechi73/OpenShamrock.git
synced 2024-08-14 13:12:17 +08:00
Shamrock
: fix #155
This commit is contained in:
parent
6107ec6ffb
commit
6ee5ceb321
@ -18,7 +18,6 @@ public final class MarkdownElement {
|
||||
}
|
||||
|
||||
public MarkdownElement(String str) {
|
||||
this.content = "";
|
||||
this.content = str;
|
||||
}
|
||||
}
|
||||
|
@ -53,6 +53,7 @@ internal object MessageConvert {
|
||||
MsgConstant.KELEMTYPEREPLY to MessageElemConverter.ReplyConverter,
|
||||
MsgConstant.KELEMTYPEGRAYTIP to MessageElemConverter.GrayTipsConverter,
|
||||
MsgConstant.KELEMTYPEFILE to MessageElemConverter.FileConverter,
|
||||
MsgConstant.KELEMTYPEMARKDOWN to MessageElemConverter.MarkdownConverter,
|
||||
//MsgConstant.KELEMTYPEMULTIFORWARD to MessageElemConverter.XmlMultiMsgConverter,
|
||||
//MsgConstant.KELEMTYPESTRUCTLONGMSG to MessageElemConverter.XmlLongMsgConverter,
|
||||
)
|
||||
|
@ -412,6 +412,22 @@ internal sealed class MessageElemConverter: IMessageConvert {
|
||||
}
|
||||
}
|
||||
|
||||
object MarkdownConverter: MessageElemConverter() {
|
||||
override suspend fun convert(
|
||||
chatType: Int,
|
||||
peerId: String,
|
||||
element: MsgElement
|
||||
): MessageSegment {
|
||||
val markdown = element.markdownElement
|
||||
return MessageSegment(
|
||||
type = "markdown",
|
||||
data = mapOf(
|
||||
"content" to markdown.content
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
protected fun unknownChatType(chatType: Int) {
|
||||
throw UnsupportedOperationException("Not supported chat type: $chatType")
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user