mirror of
https://github.com/InsanusMokrassar/PlaguBot.git
synced 2024-11-21 23:23:47 +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) {
|
||||
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