Package dev.inmo.tgbotapi.extensions.utils.extensions

Functions

download
Link copied to clipboard
common
suspend fun PathedFile.download(telegramAPIUrlsKeeper: TelegramAPIUrlsKeeper, client: HttpClient = HttpClient()): ByteArray
loadFile
Link copied to clipboard
common
suspend fun HttpClient.loadFile(telegramAPIUrlsKeeper: TelegramAPIUrlsKeeper, pathedFile: PathedFile): ByteArray
suspend fun HttpClient.loadFile(telegramAPIUrlsKeeper: TelegramAPIUrlsKeeper, filePath: String): ByteArray
parseCommandsWithParams
Link copied to clipboard
common
fun TextedWithTextSources.parseCommandsWithParams(argsSeparator: Regex = defaultArgsSeparator): Map<String, Array<String>>
fun ContentMessage<TextContent>.parseCommandsWithParams(argsSeparator: Regex = defaultArgsSeparator): Map<String, Array<String>>
fun List<TextSource>.parseCommandsWithParams(argsSeparator: Regex = defaultArgsSeparator): MutableMap<String, Array<String>>

Parse commands and their args. Logic will find command, get all subsequent data as args until new command

sourceChat
Link copied to clipboard
common
fun Update.sourceChat(): Chat?
sourceUser
Link copied to clipboard
common
fun Update.sourceUser(): User?

Properties

defaultArgsSeparator
Link copied to clipboard
common
val defaultArgsSeparator: Regex