mirror of
https://github.com/InsanusMokrassar/PlaguBot.git
synced 2024-11-22 07:33:46 +00:00
make plugin more correctly serializable
This commit is contained in:
parent
d3d5e70818
commit
ceb60e3c6a
@ -45,7 +45,9 @@ object PluginSerializer : KSerializer<Plugin> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@InternalSerializationApi
|
||||||
override fun serialize(encoder: Encoder, value: Plugin) {
|
override fun serialize(encoder: Encoder, value: Plugin) {
|
||||||
polymorphic.serialize(encoder, value)
|
val serializer = (value::class.serializerOrNull() ?: polymorphic) as KSerializer<Plugin>
|
||||||
|
serializer.serialize(encoder, value)
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user