mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-26 03:58:44 +00:00
fixes
This commit is contained in:
parent
2b49a75a42
commit
270f9a60c1
@ -71,7 +71,7 @@ val User.link: String
|
|||||||
|
|
||||||
typealias UserId = ChatId
|
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
|
||||||
|
|
||||||
|
@ -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