1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2025-12-02 20:35:43 +00:00

Compare commits

..

7 Commits

Author SHA1 Message Date
249efeee7e update scripts 2021-11-14 19:42:03 +06:00
b8cc2421b6 update dependencies 2021-11-14 19:15:09 +06:00
2fa1a064ec start 0.37.1 2021-11-14 19:14:06 +06:00
63e864741e update changelog and several kdocs 2021-11-11 12:24:10 +06:00
e4f35c0eba update KDocs 2021-11-11 12:11:58 +06:00
944fe6d820 Update CHANGELOG.md 2021-11-11 11:14:05 +06:00
8ea50f36aa Merge pull request #493 from InsanusMokrassar/0.37.0
0.37.0
2021-11-10 14:48:53 +06:00
16 changed files with 153 additions and 46 deletions

View File

@@ -1,6 +1,16 @@
# TelegramBotAPI changelog
## 0.37.0
## 0.37.1
* `Common`:
* `Version`:
* `Serialization`: `1.3.0` -> `1.3.1`
* `Klock`: `2.4.7` -> `2.4.8`
* `MicroUtils`: `0.8.1` -> `0.8.2`
## 0.37.0 Telegram Bot API 5.4
**ALL DEPRECATIONS WERE REMOVED**
* `Common`:
* `Version`:
@@ -15,6 +25,13 @@
* `EditChatInviteLinkSimple`
* `EditChatInviteLinkWithLimitedMembers`
* `EditChatInviteLinkWithJoinRequest`
* New `BotAction`: `ChooseStickerAction`
* Now requester will throw exceptions related to responses decoding directly instead of wrapping in
`RequestException`
*
* `BehaviourBuilder FSM`:
* **Incompatible changes** (now generics are used in state machines)
* `strictlyOn` and `onStateOrSubstate` now are part of `BehaviourContextWithFSMBuilder`
## 0.36.1

View File

@@ -23,7 +23,13 @@ repositories {
}
kotlin {
jvm()
jvm {
compilations.main {
kotlinOptions {
jvmTarget = "1.8"
}
}
}
js(IR) {
browser()
nodejs()
@@ -91,3 +97,8 @@ Object callback = {
tasks.dokkaGfm(callback)
tasks.dokkaHtml(callback)
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

View File

@@ -7,16 +7,16 @@ kotlin.incremental.js=true
kotlin_version=1.5.31
kotlin_coroutines_version=1.5.2
kotlin_serialisation_runtime_version=1.3.0
klock_version=2.4.7
kotlin_serialisation_runtime_version=1.3.1
klock_version=2.4.8
uuid_version=0.3.1
ktor_version=1.6.5
micro_utils_version=0.8.1
micro_utils_version=0.8.2
javax_activation_version=1.1.1
library_group=dev.inmo
library_version=0.37.0
library_version=0.37.1
github_release_plugin_version=2.2.12

View File

@@ -26,7 +26,13 @@ repositories {
}
kotlin {
jvm()
jvm {
compilations.main {
kotlinOptions {
jvmTarget = "1.8"
}
}
}
js(IR) {
browser()
nodejs()
@@ -43,8 +49,7 @@ kotlin {
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

View File

@@ -26,7 +26,13 @@ repositories {
}
kotlin {
jvm()
jvm {
compilations.main {
kotlinOptions {
jvmTarget = "1.8"
}
}
}
js(IR) {
browser()
nodejs()
@@ -44,7 +50,6 @@ kotlin {
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

View File

@@ -26,7 +26,13 @@ repositories {
}
kotlin {
jvm()
jvm {
compilations.main {
kotlinOptions {
jvmTarget = "1.8"
}
}
}
js(IR) {
browser()
nodejs()
@@ -43,7 +49,6 @@ kotlin {
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

View File

@@ -26,7 +26,13 @@ repositories {
}
kotlin {
jvm()
jvm {
compilations.main {
kotlinOptions {
jvmTarget = "1.8"
}
}
}
js(IR) {
browser()
nodejs()
@@ -94,7 +100,6 @@ kotlin {
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

View File

@@ -5,6 +5,9 @@ import dev.inmo.tgbotapi.types.*
import kotlinx.serialization.*
import kotlinx.serialization.builtins.serializer
/**
* Represent a join request answer. See inheritors for more info
*/
sealed interface ChatJoinRequestAnswer : SimpleRequest<Boolean> {
val chatId: ChatIdentifier
val userId: UserId
@@ -13,6 +16,10 @@ sealed interface ChatJoinRequestAnswer : SimpleRequest<Boolean> {
get() = Boolean.serializer()
}
/**
* Represent [approve](https://core.telegram.org/bots/api#approvechatjoinrequest) [ChatJoinRequestAnswer]. You may approve
* the requests retrieved in with [ChatJoinRequest] (in [dev.inmo.tgbotapi.types.update.ChatJoinRequestUpdate])
*/
@Serializable
data class ApproveChatJoinRequest(
@SerialName(chatIdField)
@@ -26,6 +33,10 @@ data class ApproveChatJoinRequest(
override fun method(): String = "approveChatJoinRequest"
}
/**
* Represent [decline](https://core.telegram.org/bots/api#declinechatjoinrequest) [ChatJoinRequestAnswer]. You may approve
* the requests retrieved in with [ChatJoinRequest] (in [dev.inmo.tgbotapi.types.update.ChatJoinRequestUpdate])
*/
@Serializable
data class DeclineChatJoinRequest(
@SerialName(chatIdField)

View File

@@ -42,6 +42,9 @@ private fun ChatInviteLink.toRawChatInviteLink() = RawChatInviteLink(
(this as? ChatInviteLinkWithJoinRequest) ?.leftToReview
)
/**
* Base interface for all chat invite links. See inheritors for more info or official [docs](https://core.telegram.org/bots/api#chatinvitelink)
*/
@Serializable(ChatInviteLinkSerializer::class)
sealed interface ChatInviteLink : WithUser {
val inviteLink: String
@@ -60,6 +63,9 @@ sealed interface ChatInviteLink : WithUser {
}
}
/**
* Base interface for all [ChatInviteLink]s which are NOT [PrimaryInviteLink]
*/
@Serializable(ChatInviteLinkSerializer::class)
sealed interface SecondaryChatInviteLink : ChatInviteLink {
override val isPrimary: Boolean
@@ -70,6 +76,9 @@ sealed interface SecondaryChatInviteLink : ChatInviteLink {
}
}
/**
* Primary invite link in the chat for this bot
*/
@Serializable
data class PrimaryInviteLink(
@SerialName(inviteLinkField)
@@ -87,6 +96,12 @@ data class PrimaryInviteLink(
get() = null
}
/**
* Represent [SecondaryChatInviteLink] which will require an aprovement from one of the administrators
*
* @see ChatJoinRequest
* @see dev.inmo.tgbotapi.types.update.ChatJoinRequestUpdate
*/
@Serializable
data class ChatInviteLinkWithJoinRequest(
@SerialName(inviteLinkField)
@@ -106,6 +121,9 @@ data class ChatInviteLinkWithJoinRequest(
get() = expireDate ?.asDate
}
/**
* Represent [SecondaryChatInviteLink] which will have limitation for the amount of chat members to join
*/
@Serializable
data class ChatInviteLinkWithLimitedMembers(
@SerialName(inviteLinkField)
@@ -125,6 +143,10 @@ data class ChatInviteLinkWithLimitedMembers(
get() = expireDate ?.asDate
}
/**
* Represent [SecondaryChatInviteLink] which have no any restrictions like [ChatInviteLinkWithJoinRequest] or
* [ChatInviteLinkWithLimitedMembers]
*/
@Serializable
data class ChatInviteLinkUnlimited(
@SerialName(inviteLinkField)

View File

@@ -5,6 +5,9 @@ import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
/**
* Represent a [ChatJoinRequest](https://core.telegram.org/bots/api#chatjoinrequest)
*/
@Serializable
data class ChatJoinRequest(
@SerialName(chatField)

View File

@@ -26,7 +26,13 @@ repositories {
}
kotlin {
jvm()
jvm {
compilations.main {
kotlinOptions {
jvmTarget = "1.8"
}
}
}
js(IR) {
browser()
nodejs()
@@ -43,8 +49,7 @@ kotlin {
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

View File

@@ -43,8 +43,7 @@ kotlin {
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

View File

@@ -26,7 +26,13 @@ repositories {
}
kotlin {
jvm()
jvm {
compilations.main {
kotlinOptions {
jvmTarget = "1.8"
}
}
}
js(IR) {
browser()
nodejs()
@@ -43,8 +49,7 @@ kotlin {
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

View File

@@ -26,7 +26,13 @@ repositories {
}
kotlin {
jvm()
jvm {
compilations.main {
kotlinOptions {
jvmTarget = "1.8"
}
}
}
js(IR) {
browser()
nodejs()
@@ -43,8 +49,7 @@ kotlin {
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

View File

@@ -26,7 +26,13 @@ repositories {
}
kotlin {
jvm()
jvm {
compilations.main {
kotlinOptions {
jvmTarget = "1.8"
}
}
}
js(IR) {
browser()
nodejs()
@@ -61,7 +67,6 @@ kotlin {
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

View File

@@ -26,7 +26,13 @@ repositories {
}
kotlin {
jvm()
jvm {
compilations.main {
kotlinOptions {
jvmTarget = "1.8"
}
}
}
js(IR) {
browser()
nodejs()
@@ -46,10 +52,8 @@ kotlin {
}
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}