Replies: 2 comments
-
解决了,就当无事发生() |
Beta Was this translation helpful? Give feedback.
0 replies
-
虽然解决了我还是来回复一下 Kotlin: public inline fun buildForwardMessage(
context: Contact,
displayStrategy: DisplayStrategy = DisplayStrategy,
block: ForwardMessageBuilder.() -> Unit
): ForwardMessage = ForwardMessageBuilder(context).apply { this.displayStrategy = displayStrategy }.apply(block).build() public fun Iterable<MessageEvent>.toForwardMessage(displayStrategy: DisplayStrategy = DisplayStrategy): ForwardMessage {
val iterator = this.iterator()
if (!iterator.hasNext()) return RawForwardMessage(emptyList()).render(displayStrategy)
return RawForwardMessage(
this.map { ForwardMessage.Node(it.sender.id, it.time, it.senderName, it.message) }
).render(displayStrategy)
} Java: ForwardMessageBuilder builder = new ForwardMessageBuilder(group);
builder.add(new ForwardMessage.Node( 123456L, System.currentTimeMillis() / 1000, "群员A", message));
builder.setDisplayStrategy(new ForwardMessage.DisplayStrategy() {
// 实现方法
});
builder.build(); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
想用dsl构造聊天记录,往里塞使用说明之类会刷屏的文本,想自定义聊天记录的标题等外观
Beta Was this translation helpful? Give feedback.
All reactions