mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-22 08:13:47 +00:00
commit
7bab96a9cd
7
.github/workflows/packages_publishing.yml
vendored
7
.github/workflows/packages_publishing.yml
vendored
@ -16,7 +16,12 @@ jobs:
|
|||||||
mv gradle.properties.tmp gradle.properties
|
mv gradle.properties.tmp gradle.properties
|
||||||
- name: Build
|
- name: Build
|
||||||
run: ./gradlew build
|
run: ./gradlew build
|
||||||
- name: Publish
|
- name: Publish to Gitea
|
||||||
|
continue-on-error: true
|
||||||
|
run: ./gradlew publishAllPublicationsToGiteaRepository
|
||||||
|
env:
|
||||||
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
|
- name: Publish to GithubPackages
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
run: ./gradlew publishAllPublicationsToGithubPackagesRepository --no-parallel
|
run: ./gradlew publishAllPublicationsToGithubPackagesRepository --no-parallel
|
||||||
env:
|
env:
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
# TelegramBotAPI changelog
|
# TelegramBotAPI changelog
|
||||||
|
|
||||||
|
## 4.1.3
|
||||||
|
|
||||||
|
* `Versions`:
|
||||||
|
* `MicroUtils`: `0.14.2` -> `0.14.4`
|
||||||
|
* `Core`:
|
||||||
|
* `ContentMessage`, `CommonMessage`, `PossiblyMediaGroupMessage` and `PossiblySentViaBotCommonMessage` got `out`
|
||||||
|
variance
|
||||||
|
* `UserId` now is `ChatId` instead of `IdChatIdentififer`
|
||||||
|
|
||||||
## 4.1.2
|
## 4.1.2
|
||||||
|
|
||||||
* `Versions`:
|
* `Versions`:
|
||||||
|
@ -6,4 +6,4 @@ kotlin.incremental=true
|
|||||||
kotlin.incremental.js=true
|
kotlin.incremental.js=true
|
||||||
|
|
||||||
library_group=dev.inmo
|
library_group=dev.inmo
|
||||||
library_version=4.1.2
|
library_version=4.1.3
|
||||||
|
@ -13,7 +13,7 @@ ktor = "2.1.3"
|
|||||||
ksp = "1.7.21-1.0.8"
|
ksp = "1.7.21-1.0.8"
|
||||||
kotlin-poet = "1.12.0"
|
kotlin-poet = "1.12.0"
|
||||||
|
|
||||||
microutils = "0.14.2"
|
microutils = "0.14.4"
|
||||||
|
|
||||||
github-release-plugin = "2.4.1"
|
github-release-plugin = "2.4.1"
|
||||||
dokka = "1.7.20"
|
dokka = "1.7.20"
|
||||||
|
@ -69,9 +69,9 @@ val UserId.userLink: String
|
|||||||
val User.link: String
|
val User.link: String
|
||||||
get() = id.userLink
|
get() = id.userLink
|
||||||
|
|
||||||
typealias UserId = IdChatIdentifier
|
typealias UserId = ChatId
|
||||||
|
|
||||||
fun Identifier.toChatId(): IdChatIdentifier = ChatId(this)
|
fun Identifier.toChatId(): ChatId = ChatId(this)
|
||||||
fun Int.toChatId(): IdChatIdentifier = toLong().toChatId()
|
fun Int.toChatId(): IdChatIdentifier = toLong().toChatId()
|
||||||
fun Byte.toChatId(): IdChatIdentifier = toLong().toChatId()
|
fun Byte.toChatId(): IdChatIdentifier = toLong().toChatId()
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ data class ExtendedGroupChatImpl(
|
|||||||
@Serializable
|
@Serializable
|
||||||
data class ExtendedPrivateChatImpl(
|
data class ExtendedPrivateChatImpl(
|
||||||
@SerialName(idField)
|
@SerialName(idField)
|
||||||
override val id: IdChatIdentifier,
|
override val id: UserId,
|
||||||
@SerialName(photoField)
|
@SerialName(photoField)
|
||||||
override val chatPhoto: ChatPhoto? = null,
|
override val chatPhoto: ChatPhoto? = null,
|
||||||
@SerialName(usernameField)
|
@SerialName(usernameField)
|
||||||
|
@ -18,7 +18,7 @@ data class GroupChatImpl(
|
|||||||
@Serializable
|
@Serializable
|
||||||
data class PrivateChatImpl(
|
data class PrivateChatImpl(
|
||||||
@SerialName(idField)
|
@SerialName(idField)
|
||||||
override val id: IdChatIdentifier,
|
override val id: UserId,
|
||||||
@SerialName(usernameField)
|
@SerialName(usernameField)
|
||||||
override val username: Username? = null,
|
override val username: Username? = null,
|
||||||
@SerialName(firstNameField)
|
@SerialName(firstNameField)
|
||||||
|
@ -42,6 +42,7 @@ sealed interface Sticker : TelegramMediaFile, SizedMediaFile, ThumbedMediaFile {
|
|||||||
get() = false
|
get() = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OptIn(RiskFeature::class)
|
||||||
object StickerSerializer : KSerializer<Sticker> {
|
object StickerSerializer : KSerializer<Sticker> {
|
||||||
override val descriptor: SerialDescriptor = StickerSurrogate.serializer().descriptor
|
override val descriptor: SerialDescriptor = StickerSurrogate.serializer().descriptor
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ package dev.inmo.tgbotapi.types.message.abstracts
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.types.message.content.MessageContent
|
import dev.inmo.tgbotapi.types.message.content.MessageContent
|
||||||
|
|
||||||
sealed interface CommonMessage<T: MessageContent> : Message,
|
sealed interface CommonMessage<out T: MessageContent> : Message,
|
||||||
PossiblyForwardedMessage,
|
PossiblyForwardedMessage,
|
||||||
PossiblyEditedMessage,
|
PossiblyEditedMessage,
|
||||||
PossiblyReplyMessage,
|
PossiblyReplyMessage,
|
||||||
|
@ -2,7 +2,7 @@ package dev.inmo.tgbotapi.types.message.abstracts
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.types.message.content.MessageContent
|
import dev.inmo.tgbotapi.types.message.content.MessageContent
|
||||||
|
|
||||||
interface ContentMessage<T: MessageContent>: Message {
|
interface ContentMessage<out T: MessageContent>: Message {
|
||||||
val hasProtectedContent: Boolean
|
val hasProtectedContent: Boolean
|
||||||
val content: T
|
val content: T
|
||||||
|
|
||||||
|
@ -3,6 +3,6 @@ package dev.inmo.tgbotapi.types.message.abstracts
|
|||||||
import dev.inmo.tgbotapi.types.MediaGroupIdentifier
|
import dev.inmo.tgbotapi.types.MediaGroupIdentifier
|
||||||
import dev.inmo.tgbotapi.types.message.content.MessageContent
|
import dev.inmo.tgbotapi.types.message.content.MessageContent
|
||||||
|
|
||||||
interface PossiblyMediaGroupMessage<T : MessageContent> : ContentMessage<T> {
|
interface PossiblyMediaGroupMessage<out T : MessageContent> : ContentMessage<T> {
|
||||||
val mediaGroupId: MediaGroupIdentifier?
|
val mediaGroupId: MediaGroupIdentifier?
|
||||||
}
|
}
|
||||||
|
@ -2,4 +2,4 @@ package dev.inmo.tgbotapi.types.message.abstracts
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.types.message.content.MessageContent
|
import dev.inmo.tgbotapi.types.message.content.MessageContent
|
||||||
|
|
||||||
sealed interface PossiblySentViaBotCommonMessage<T: MessageContent> : CommonMessage<T>, PossiblySentViaBot
|
sealed interface PossiblySentViaBotCommonMessage<out T: MessageContent> : CommonMessage<T>, PossiblySentViaBot
|
||||||
|
@ -200,7 +200,7 @@ infix fun String.mention(parseMode: ParseMode): String = when (parseMode) {
|
|||||||
is MarkdownV2 -> mentionMarkdownV2()
|
is MarkdownV2 -> mentionMarkdownV2()
|
||||||
}
|
}
|
||||||
|
|
||||||
infix fun Pair<String, IdChatIdentifier>.mention(parseMode: ParseMode): String = when (parseMode) {
|
infix fun Pair<String, UserId>.mention(parseMode: ParseMode): String = when (parseMode) {
|
||||||
is HTML -> first.textMentionHTML(second)
|
is HTML -> first.textMentionHTML(second)
|
||||||
is Markdown -> first.textMentionMarkdown(second)
|
is Markdown -> first.textMentionMarkdown(second)
|
||||||
is MarkdownV2 -> first.textMentionMarkdownV2(second)
|
is MarkdownV2 -> first.textMentionMarkdownV2(second)
|
||||||
|
Loading…
Reference in New Issue
Block a user