SchlaubiBus
SchlaubiBus
Explore posts from servers
KKord
Created by Tic on 1/25/2025 in #help
(Not Kord) Deserialize JSON with unordered fields (Kotlin Serialization)
No idea tbh
33 replies
KKord
Created by Tic on 1/25/2025 in #help
(Not Kord) Deserialize JSON with unordered fields (Kotlin Serialization)
use some binary format like protobuf
33 replies
KKord
Created by Tic on 1/25/2025 in #help
(Not Kord) Deserialize JSON with unordered fields (Kotlin Serialization)
if you're worried about traffic you shouldn't use json
33 replies
KKord
Created by Tic on 1/25/2025 in #help
(Not Kord) Deserialize JSON with unordered fields (Kotlin Serialization)
not without a custom serializer no
33 replies
KKord
Created by Tic on 1/25/2025 in #help
(Not Kord) Deserialize JSON with unordered fields (Kotlin Serialization)
whether you encode 0 or "0" won't make a difference
33 replies
KKord
Created by Tic on 1/25/2025 in #help
(Not Kord) Deserialize JSON with unordered fields (Kotlin Serialization)
especially if you use numbers
33 replies
KKord
Created by Tic on 1/25/2025 in #help
(Not Kord) Deserialize JSON with unordered fields (Kotlin Serialization)
well using a byte will make little difference then
33 replies
KKord
Created by Tic on 1/25/2025 in #help
(Not Kord) Deserialize JSON with unordered fields (Kotlin Serialization)
do you use json?
33 replies
KKord
Created by Tic on 1/25/2025 in #help
(Not Kord) Deserialize JSON with unordered fields (Kotlin Serialization)
@Serializable
sealed interface Packet {
val data: Data

interface Data
}

@Serializable
@SerialName("hello")
data class HelloPacket(override val data: Data) : Packet {
@Serializable
data class Data(val pingInterval: Int) : Packet.Data
}
@Serializable
sealed interface Packet {
val data: Data

interface Data
}

@Serializable
@SerialName("hello")
data class HelloPacket(override val data: Data) : Packet {
@Serializable
data class Data(val pingInterval: Int) : Packet.Data
}
33 replies
KKord
Created by Tic on 1/25/2025 in #help
(Not Kord) Deserialize JSON with unordered fields (Kotlin Serialization)
you can make something like this
33 replies
KKord
Created by Tic on 1/25/2025 in #help
(Not Kord) Deserialize JSON with unordered fields (Kotlin Serialization)
doesn't have to
33 replies
KKord
Created by Tic on 1/25/2025 in #help
(Not Kord) Deserialize JSON with unordered fields (Kotlin Serialization)
yeah sadly kx.ser cannot do that, the best way is to not use a byte or use the JsonContentPolymorphicSerializer
33 replies
KKord
Created by Tic on 1/25/2025 in #help
(Not Kord) Deserialize JSON with unordered fields (Kotlin Serialization)
You can also use a JsonContentPolymorphicSerializer (i think that was the name), or save everything into a map first
33 replies
KKord
Created by Tic on 1/25/2025 in #help
(Not Kord) Deserialize JSON with unordered fields (Kotlin Serialization)
Yeah don't use a custom serializr, an auto generated serializer could handle that
33 replies
KKord
Created by thelooter on 12/15/2024 in #help
Get Heartbeat of Gateway
you should be able to check whether the Gateways coroutine scope isActive, as when it gives up to reconnect it closes
4 replies
KKord
Created by iReqen on 12/6/2024 in #help
Adding a file to a message using getResourceAsStream
You can use ChannelProvider { imageStream.toByteReadChannel() }
6 replies
KKord
Created by iReqen on 12/5/2024 in #help
Embed markdown for headers not working properly
I thought I did+
19 replies
KKord
Created by iReqen on 12/5/2024 in #help
Embed markdown for headers not working properly
@gdude [he/him] How do I get @Answer Overflow to do this mark as solution reminder
19 replies
KKord
Created by iReqen on 12/5/2024 in #help
Embed markdown for headers not working properly
gdude was faster than me
19 replies
KKord
Created by BEQI on 11/28/2024 in #help
Custom status/activity
14 replies