registerSerializer
注册 serializer 到 type 的所有为 SingleMessage 子类型的超类型的多态域 PolymorphicModuleBuilder.subclass
实现:
for (superclass in type.allSuperclasses) {
if (superclass.isFinal) continue
if (superclass.isSubclassOf(SingleMessage::class)) continue
polymorphic(superclass) {
subclass(type, serializer)
}
}
Content copied to clipboard
若要自己实现消息类型, 务必在这里注册对应序列化器, 否则在 MessageChain.serializeToJsonString 时将会出错.
Since
2.0, revised 2.3