mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-11-30 11:25:44 +00:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| be28c9bd5d | |||
| a193ef5fd5 | |||
| 7c43d3aaa5 | |||
| e034afc75c | |||
| 08e3326d1a | |||
| 6dd1825b98 | |||
| bd4eb29fc1 | |||
| 2cc66ef13c | |||
| 9a8175d1c8 | |||
| 25285b2e8a | |||
| bb09f05d7b |
21
CHANGELOG.md
21
CHANGELOG.md
@@ -1,5 +1,26 @@
|
|||||||
# TelegramBotAPI changelog
|
# TelegramBotAPI changelog
|
||||||
|
|
||||||
|
## 0.30.10
|
||||||
|
|
||||||
|
* `Common`:
|
||||||
|
* `Version`:
|
||||||
|
* `Kotlin`: `1.4.20` -> `1.4.21`
|
||||||
|
* `Klock`: `2.0.0` -> `2.0.1`
|
||||||
|
* `Ktor`: `1.4.2` -> `1.4.3`
|
||||||
|
* `MicroUtils`: `0.4.6` -> `0.4.11`
|
||||||
|
* `API Extensions`:
|
||||||
|
* New function `buildBot`
|
||||||
|
|
||||||
|
## 0.30.9
|
||||||
|
|
||||||
|
* `Common`:
|
||||||
|
* `Version`:
|
||||||
|
* `UUID`: `0.2.2` -> `0.2.3`
|
||||||
|
* `Coroutines`: `1.4.1` -> `1.4.2`
|
||||||
|
* `MicroUtils`: `0.4.3` -> `0.4.6`
|
||||||
|
* `Core`:
|
||||||
|
* Add `BowlingDiceAnimationType`
|
||||||
|
|
||||||
## 0.30.8
|
## 0.30.8
|
||||||
|
|
||||||
* `Common`:
|
* `Common`:
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
dokka_version=1.4.0
|
dokka_version=1.4.20
|
||||||
|
|
||||||
org.gradle.jvmargs=-Xmx1024m
|
org.gradle.jvmargs=-Xmx1024m
|
||||||
|
|||||||
@@ -5,18 +5,18 @@ kotlin.js.generate.externals=true
|
|||||||
kotlin.incremental=true
|
kotlin.incremental=true
|
||||||
kotlin.incremental.js=true
|
kotlin.incremental.js=true
|
||||||
|
|
||||||
kotlin_version=1.4.20
|
kotlin_version=1.4.21
|
||||||
kotlin_coroutines_version=1.4.1
|
kotlin_coroutines_version=1.4.2
|
||||||
kotlin_serialisation_runtime_version=1.0.1
|
kotlin_serialisation_runtime_version=1.0.1
|
||||||
klock_version=2.0.0
|
klock_version=2.0.1
|
||||||
uuid_version=0.2.2
|
uuid_version=0.2.3
|
||||||
ktor_version=1.4.2
|
ktor_version=1.4.3
|
||||||
|
|
||||||
micro_utils_version=0.4.3
|
micro_utils_version=0.4.11
|
||||||
|
|
||||||
javax_activation_version=1.1.1
|
javax_activation_version=1.1.1
|
||||||
|
|
||||||
library_group=dev.inmo
|
library_group=dev.inmo
|
||||||
library_version=0.30.8
|
library_version=0.30.10
|
||||||
|
|
||||||
github_release_plugin_version=2.2.12
|
github_release_plugin_version=2.2.12
|
||||||
|
|||||||
@@ -61,10 +61,13 @@ val inlineQueryAnswerResultsLimit = 0 .. 50
|
|||||||
|
|
||||||
val customTitleLength = 0 .. 16
|
val customTitleLength = 0 .. 16
|
||||||
|
|
||||||
val dartsAndCubeDiceResultLimit = 1 .. 6
|
val dartsCubeAndBowlingDiceResultLimit = 1 .. 6
|
||||||
@Deprecated("Renamed", ReplaceWith("dartsAndCubeDiceResultLimit", "dev.inmo.tgbotapi.types.dartsAndCubeDiceResultLimit"))
|
@Deprecated("Renamed", ReplaceWith("dartsCubeAndBowlingDiceResultLimit", "dev.inmo.tgbotapi.types.dartsCubeAndBowlingDiceResultLimit"))
|
||||||
|
val dartsAndCubeDiceResultLimit
|
||||||
|
get() = dartsCubeAndBowlingDiceResultLimit
|
||||||
|
@Deprecated("Renamed", ReplaceWith("dartsCubeAndBowlingDiceResultLimit", "dev.inmo.tgbotapi.types.dartsCubeAndBowlingDiceResultLimit"))
|
||||||
val diceResultLimit
|
val diceResultLimit
|
||||||
get() = dartsAndCubeDiceResultLimit
|
get() = dartsCubeAndBowlingDiceResultLimit
|
||||||
val basketballAndFootballDiceResultLimit = 1 .. 5
|
val basketballAndFootballDiceResultLimit = 1 .. 5
|
||||||
val slotMachineDiceResultLimit = 1 .. 64
|
val slotMachineDiceResultLimit = 1 .. 64
|
||||||
|
|
||||||
|
|||||||
@@ -15,13 +15,13 @@ sealed class DiceAnimationType {
|
|||||||
object CubeDiceAnimationType : DiceAnimationType() {
|
object CubeDiceAnimationType : DiceAnimationType() {
|
||||||
override val emoji: String = "\uD83C\uDFB2"
|
override val emoji: String = "\uD83C\uDFB2"
|
||||||
override val valueLimits: IntRange
|
override val valueLimits: IntRange
|
||||||
get() = dartsAndCubeDiceResultLimit
|
get() = dartsCubeAndBowlingDiceResultLimit
|
||||||
}
|
}
|
||||||
@Serializable(DiceAnimationTypeSerializer::class)
|
@Serializable(DiceAnimationTypeSerializer::class)
|
||||||
object DartsDiceAnimationType : DiceAnimationType() {
|
object DartsDiceAnimationType : DiceAnimationType() {
|
||||||
override val emoji: String = "\uD83C\uDFAF"
|
override val emoji: String = "\uD83C\uDFAF"
|
||||||
override val valueLimits: IntRange
|
override val valueLimits: IntRange
|
||||||
get() = dartsAndCubeDiceResultLimit
|
get() = dartsCubeAndBowlingDiceResultLimit
|
||||||
}
|
}
|
||||||
@Serializable(DiceAnimationTypeSerializer::class)
|
@Serializable(DiceAnimationTypeSerializer::class)
|
||||||
object BasketballDiceAnimationType : DiceAnimationType() {
|
object BasketballDiceAnimationType : DiceAnimationType() {
|
||||||
@@ -36,6 +36,12 @@ object FootballDiceAnimationType : DiceAnimationType() {
|
|||||||
get() = basketballAndFootballDiceResultLimit
|
get() = basketballAndFootballDiceResultLimit
|
||||||
}
|
}
|
||||||
@Serializable(DiceAnimationTypeSerializer::class)
|
@Serializable(DiceAnimationTypeSerializer::class)
|
||||||
|
object BowlingDiceAnimationType : DiceAnimationType() {
|
||||||
|
override val emoji: String = "\uD83C\uDFB3"
|
||||||
|
override val valueLimits: IntRange
|
||||||
|
get() = dartsCubeAndBowlingDiceResultLimit
|
||||||
|
}
|
||||||
|
@Serializable(DiceAnimationTypeSerializer::class)
|
||||||
object SlotMachineDiceAnimationType : DiceAnimationType() {
|
object SlotMachineDiceAnimationType : DiceAnimationType() {
|
||||||
override val emoji: String = "\uD83C\uDFB0"
|
override val emoji: String = "\uD83C\uDFB0"
|
||||||
override val valueLimits: IntRange
|
override val valueLimits: IntRange
|
||||||
@@ -59,6 +65,7 @@ internal object DiceAnimationTypeSerializer : KSerializer<DiceAnimationType> {
|
|||||||
BasketballDiceAnimationType.emoji -> BasketballDiceAnimationType
|
BasketballDiceAnimationType.emoji -> BasketballDiceAnimationType
|
||||||
SlotMachineDiceAnimationType.emoji -> SlotMachineDiceAnimationType
|
SlotMachineDiceAnimationType.emoji -> SlotMachineDiceAnimationType
|
||||||
FootballDiceAnimationType.emoji -> FootballDiceAnimationType
|
FootballDiceAnimationType.emoji -> FootballDiceAnimationType
|
||||||
|
BowlingDiceAnimationType.emoji -> BowlingDiceAnimationType
|
||||||
else -> CustomDiceAnimationType(type)
|
else -> CustomDiceAnimationType(type)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package dev.inmo.tgbotapi.extensions.api
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.utils.TelegramAPIUrlsKeeper
|
import dev.inmo.tgbotapi.utils.TelegramAPIUrlsKeeper
|
||||||
|
import dev.inmo.tgbotapi.utils.telegramBotAPIDefaultUrl
|
||||||
import io.ktor.client.HttpClient
|
import io.ktor.client.HttpClient
|
||||||
import io.ktor.client.HttpClientConfig
|
import io.ktor.client.HttpClientConfig
|
||||||
import io.ktor.client.engine.*
|
import io.ktor.client.engine.*
|
||||||
@@ -36,10 +37,25 @@ data class BotBuilder internal constructor(
|
|||||||
* @return Created by [telegramBotWithCustomClientConfig] function [TelegramBot]. This executor will be preconfigured using [token] and
|
* @return Created by [telegramBotWithCustomClientConfig] function [TelegramBot]. This executor will be preconfigured using [token] and
|
||||||
* [block]
|
* [block]
|
||||||
*/
|
*/
|
||||||
|
fun buildBot(
|
||||||
|
token: String,
|
||||||
|
apiUrl: String = telegramBotAPIDefaultUrl,
|
||||||
|
block: BotBuilder.() -> Unit
|
||||||
|
) = telegramBot(
|
||||||
|
TelegramAPIUrlsKeeper(token, apiUrl),
|
||||||
|
BotBuilder().apply(block).createHttpClient()
|
||||||
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Created by [telegramBotWithCustomClientConfig] function [TelegramBot]. This executor will be preconfigured using [token] and
|
||||||
|
* [block]
|
||||||
|
*/
|
||||||
|
@Deprecated("Renamed", ReplaceWith("buildBot", "dev.inmo.tgbotapi.extensions.api.buildBot"))
|
||||||
fun telegramBot(
|
fun telegramBot(
|
||||||
token: String,
|
token: String,
|
||||||
block: BotBuilder.() -> Unit
|
block: BotBuilder.() -> Unit
|
||||||
): TelegramBot = telegramBot(
|
): TelegramBot = buildBot(
|
||||||
TelegramAPIUrlsKeeper(token),
|
token,
|
||||||
BotBuilder().apply(block).createHttpClient()
|
telegramBotAPIDefaultUrl,
|
||||||
|
block
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user