Package dev.inmo.tgbotapi.utils

Types

Link copied to clipboard
object BuiltinMimeTypes
Link copied to clipboard
fun interface ByteReadChannelAllocator
object ByteReadChannelAllocatorDeserializationStrategy : DeserializationStrategy<ByteReadChannelAllocator>
Link copied to clipboard
typealias FileName = String

File name like hello.jpg

Link copied to clipboard
open class MatrixBuilder<T>
Link copied to clipboard
expect class MimeType
actual class MimeType
actual class MimeType : MimeType
Link copied to clipboard
object MimeTypeSerializer : KSerializer<MimeType>
Link copied to clipboard
open class RowBuilder<T>
Link copied to clipboard
data class StorageFile(fileName: String, inputSource: () -> Input)

Contains info about file, which potentially can be sent to telegram system.

Link copied to clipboard
class TelegramAPIUrlsKeeper(token: String, hostUrl: String, urlsSuffixes: String)

Functions

Link copied to clipboard
expect suspend fun ByteReadChannel.asInput(): Input
actual suspend fun ByteReadChannel.asInput(): Input
actual suspend fun ByteReadChannel.asInput(): Input
Link copied to clipboard
fun String.asMimeType(): MimeType
Link copied to clipboard
inline suspend fun ByteReadChannelAllocator.asStorageFile(fileName: String): StorageFile
inline suspend fun ByteReadChannel.asStorageFile(fileName: String): StorageFile
inline fun ByteArray.asStorageFile(fileName: String): StorageFile
Link copied to clipboard
fun buildMimeType(raw: String): MimeType
Link copied to clipboard
fun <K, V> Map<K, V?>.mapNotNullValues(): Map<K, V>
Link copied to clipboard
fun <K, V> mapOfNotNull(vararg pairs: Pair<K, V?>): Map<K, V>
Link copied to clipboard
fun JsonObject.mapWithCommonValues(): Map<String, Any>
Link copied to clipboard
inline suspend fun StorageFile(fileName: String, byteReadChannel: ByteReadChannel): StorageFile
inline fun StorageFile(fileName: String, bytes: ByteArray): StorageFile
fun StorageFile(file: File): StorageFile
Link copied to clipboard
fun <T : Any> T.toJson(serializer: SerializationStrategy<T>): JsonObject
Link copied to clipboard
fun <T : Any> T.toJsonWithoutNulls(serializer: SerializationStrategy<T>): JsonObject
Link copied to clipboard
fun JsonArray.withoutNulls(): JsonArray
fun JsonObject.withoutNulls(): JsonObject

Properties

Link copied to clipboard
val String.fileExtension: String
Link copied to clipboard
val String.filenameFromUrl: FileName
Link copied to clipboard
const val lowLevelRiskFeatureMessage: String
Link copied to clipboard
const val telegramBotAPIDefaultUrl: String