mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-06-14 05:45:26 +00:00
Merge remote-tracking branch 'origin/0.17.0' into passport_api
This commit is contained in:
commit
e3d4a98270
10
CHANGELOG.md
10
CHANGELOG.md
|
@ -1,5 +1,15 @@
|
|||
# TelegramBotAPI changelog
|
||||
|
||||
## 0.17.0
|
||||
|
||||
* Kotlin version `1.3.31` -> `1.3.41`
|
||||
* Kotlin Coroutines version `1.2.1` -> `1.2.2`
|
||||
* Kotlin Serialization version `0.11.0` -> `0.11.1`
|
||||
* Joda Time version `2.10.1` -> `2.10.3`
|
||||
* Ktor version `1.1.4` -> `1.2.2`
|
||||
|
||||
* `RequestsExecutor` now is `Closeable`
|
||||
|
||||
## 0.16.0 Bot API 4.3
|
||||
|
||||
* `LoginURL` and `LoginURLInlineKeyboardButton` has been added
|
||||
|
|
16
build.gradle
16
build.gradle
|
@ -1,4 +1,4 @@
|
|||
project.version = "0.16.1"
|
||||
project.version = "0.17.0"
|
||||
project.group = "com.github.insanusmokrassar"
|
||||
|
||||
buildscript {
|
||||
|
@ -30,15 +30,15 @@ repositories {
|
|||
|
||||
dependencies {
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines_version"
|
||||
implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime:$kotlin_serialisation_runtime_version"
|
||||
implementation "joda-time:joda-time:$joda_time_version"
|
||||
api "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines_version"
|
||||
api "org.jetbrains.kotlinx:kotlinx-serialization-runtime:$kotlin_serialisation_runtime_version"
|
||||
api "joda-time:joda-time:$joda_time_version"
|
||||
|
||||
implementation "io.ktor:ktor-client:$ktor_version"
|
||||
implementation "io.ktor:ktor-client-cio:$ktor_version"
|
||||
api "io.ktor:ktor-client:$ktor_version"
|
||||
api "io.ktor:ktor-client-cio:$ktor_version"
|
||||
|
||||
implementation "io.ktor:ktor-server:$ktor_version"
|
||||
implementation "io.ktor:ktor-server-host-common:$ktor_version"
|
||||
api "io.ktor:ktor-server:$ktor_version"
|
||||
api "io.ktor:ktor-server-host-common:$ktor_version"
|
||||
}
|
||||
|
||||
compileKotlin {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
kotlin.code.style=official
|
||||
kotlin_version=1.3.31
|
||||
kotlin_coroutines_version=1.2.1
|
||||
kotlin_serialisation_runtime_version=0.11.0
|
||||
joda_time_version=2.10.1
|
||||
ktor_version=1.1.4
|
||||
kotlin_version=1.3.41
|
||||
kotlin_coroutines_version=1.2.2
|
||||
kotlin_serialisation_runtime_version=0.11.1
|
||||
joda_time_version=2.10.3
|
||||
ktor_version=1.2.2
|
||||
|
||||
gradle_bintray_plugin_version=1.8.4
|
||||
|
||||
|
|
|
@ -83,4 +83,8 @@ class KtorRequestsExecutor(
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun close() {
|
||||
client.close()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,8 +3,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.bot.Ktor.base
|
|||
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.*
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.utils.mapWithCommonValues
|
||||
import io.ktor.client.HttpClient
|
||||
import io.ktor.client.request.forms.MultiPartFormDataContent
|
||||
import io.ktor.client.request.forms.formData
|
||||
import io.ktor.client.request.forms.*
|
||||
import io.ktor.http.Headers
|
||||
import io.ktor.http.HttpHeaders
|
||||
|
||||
|
@ -22,7 +21,9 @@ class MultipartRequestCallFactory : AbstractRequestCallFactory() {
|
|||
when (value) {
|
||||
is MultipartFile -> append(
|
||||
key,
|
||||
value.file.asInput(),
|
||||
InputProvider {
|
||||
value.file.asInput()
|
||||
},
|
||||
Headers.build {
|
||||
append(HttpHeaders.ContentType, value.mimeType)
|
||||
append(HttpHeaders.ContentDisposition, "filename=${value.fileId}")
|
||||
|
|
|
@ -2,8 +2,9 @@ package com.github.insanusmokrassar.TelegramBotAPI.bot
|
|||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.bot.exceptions.RequestException
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.Request
|
||||
import kotlinx.io.core.Closeable
|
||||
|
||||
interface RequestsExecutor {
|
||||
interface RequestsExecutor : Closeable {
|
||||
@Throws(RequestException::class)
|
||||
suspend fun <T : Any> execute(request: Request<T>): T
|
||||
}
|
Loading…
Reference in New Issue
Block a user