Skip to content

Latest commit

 

History

History
44 lines (33 loc) · 1.4 KB

README.md

File metadata and controls

44 lines (33 loc) · 1.4 KB

koTL

GitHub stars GitHub forks License

⚠️ ALL OF THIS IS WORK IN PROGRESS ⚠️

koTL is a Kotlin library that simplifies working with Telegram's Type Language (TL) by providing seamless integration with kotlinx.serialization. It offers tools and utilities for managing TL schema, serializing and deserializing TL objects, and extending kotlinx.serialization capabilities for Telegram-related applications.

Features

  • TL schema parsing and management.
  • Serialization and deserialization of TL objects.
  • Seamless integration with kotlinx.serialization.
  • Kotlin DSL for constructing TL objects

Example of Usage

@Serializable
@Crc32(value = 0x2d84d5f5_u)
data class GetUserRequest(
    val ids: List<InputUserType>
)

@Serializable
sealed interface InputUserType

@Serializable
@Crc32(value = 0xb98886cf_u)
data object InputUserEmpty : InputUserType

@Serializable
@Crc32(value = 0xf7c1b13f_u)
data object InputUserSelf : InputUserType

@Serializable
@Crc32(value = 0xf21158c6_u)
data class InputUser(
    val userId: Long,
    val accessHash: Long
) : InputUserType