1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-22 08:13:47 +00:00

getChat updates completing

This commit is contained in:
InsanusMokrassar 2020-11-04 23:10:39 +06:00
parent fd1a15cb5d
commit 7a2ecd2dbf
8 changed files with 42 additions and 5 deletions

View File

@ -14,6 +14,10 @@
* New field `dropPendingUpdates`. It works the same as `drop_pending_updates` in [setWebhook](https://core.telegram.org/bots/api#setwebhook) * New field `dropPendingUpdates`. It works the same as `drop_pending_updates` in [setWebhook](https://core.telegram.org/bots/api#setwebhook)
section section
* New field `ExtendedPrivateChat#bio` * New field `ExtendedPrivateChat#bio`
* New data class `ChatLocation`
* New field `UnbanChatMember#onlyIfBanned`
* New fields `ExtendedChannelChat#linkedGroupChatId` and `ExtendedSupergroupChat#linkedChannelChatId`
* New fields `ExtendedSupergroupChat#location`
## 0.29.4 ## 0.29.4

View File

@ -10,7 +10,9 @@ data class UnbanChatMember(
@SerialName(chatIdField) @SerialName(chatIdField)
override val chatId: ChatIdentifier, override val chatId: ChatIdentifier,
@SerialName(userIdField) @SerialName(userIdField)
override val userId: UserId override val userId: UserId,
@SerialName(onlyIfBannedField)
val onlyIfBanned: Boolean? = null
) : ChatMemberRequest<Boolean> { ) : ChatMemberRequest<Boolean> {
override fun method(): String = "unbanChatMember" override fun method(): String = "unbanChatMember"
override val resultDeserializer: DeserializationStrategy<Boolean> override val resultDeserializer: DeserializationStrategy<Boolean>

View File

@ -0,0 +1,18 @@
package dev.inmo.tgbotapi.types
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
/**
* Represents a location to which a chat is connected.
*
* @see dev.inmo.tgbotapi.requests.chat.get.GetChat
* @see dev.inmo.tgbotapi.types.chat.abstracts.extended.ExtendedSupergroupChat
*/
@Serializable
data class ChatLocation(
@SerialName(locationField)
val location: Location,
@SerialName(addressField)
val address: String
)

View File

@ -102,6 +102,7 @@ const val slowModeDelayField = "slow_mode_delay"
const val maskPositionField = "mask_position" const val maskPositionField = "mask_position"
const val phoneNumberField = "phone_number" const val phoneNumberField = "phone_number"
const val userIdField = "user_id" const val userIdField = "user_id"
const val onlyIfBannedField = "only_if_banned"
const val containsMasksField = "contains_masks" const val containsMasksField = "contains_masks"
const val resultIdField = "result_id" const val resultIdField = "result_id"
const val inlineMessageIdField = "inline_message_id" const val inlineMessageIdField = "inline_message_id"
@ -145,6 +146,7 @@ const val pinnedMessageField = "pinned_message"
const val customTitleField = "custom_title" const val customTitleField = "custom_title"
const val optionIdsField = "option_ids" const val optionIdsField = "option_ids"
const val ipAddressField = "ip_address" const val ipAddressField = "ip_address"
const val linkedChatIdField = "linked_chat_id"
const val requestContactField = "request_contact" const val requestContactField = "request_contact"
const val requestLocationField = "request_location" const val requestLocationField = "request_location"

View File

@ -1,5 +1,8 @@
package dev.inmo.tgbotapi.types.chat.abstracts.extended package dev.inmo.tgbotapi.types.chat.abstracts.extended
import dev.inmo.tgbotapi.types.ChatId
import dev.inmo.tgbotapi.types.chat.abstracts.ChannelChat import dev.inmo.tgbotapi.types.chat.abstracts.ChannelChat
interface ExtendedChannelChat : ChannelChat, ExtendedPublicChat interface ExtendedChannelChat : ChannelChat, ExtendedPublicChat {
val linkedGroupChatId: ChatId?
}

View File

@ -1,10 +1,12 @@
package dev.inmo.tgbotapi.types.chat.abstracts.extended package dev.inmo.tgbotapi.types.chat.abstracts.extended
import dev.inmo.tgbotapi.types.StickerSetName import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.chat.abstracts.SupergroupChat import dev.inmo.tgbotapi.types.chat.abstracts.SupergroupChat
interface ExtendedSupergroupChat : SupergroupChat, ExtendedGroupChat { interface ExtendedSupergroupChat : SupergroupChat, ExtendedGroupChat {
val slowModeDelay: Long? val slowModeDelay: Long?
val stickerSetName: StickerSetName? val stickerSetName: StickerSetName?
val canSetStickerSet: Boolean val canSetStickerSet: Boolean
val linkedChannelChatId: ChatId?
val location: ChatLocation?
} }

View File

@ -23,5 +23,7 @@ data class ExtendedChannelChatImpl(
override val inviteLink: String? = null, override val inviteLink: String? = null,
@SerialName(pinnedMessageField) @SerialName(pinnedMessageField)
@Serializable(TelegramBotAPIMessageDeserializeOnlySerializer::class) @Serializable(TelegramBotAPIMessageDeserializeOnlySerializer::class)
override val pinnedMessage: Message? = null override val pinnedMessage: Message? = null,
@SerialName(linkedChatIdField)
override val linkedGroupChatId: ChatId? = null
) : ExtendedChannelChat ) : ExtendedChannelChat

View File

@ -32,5 +32,9 @@ data class ExtendedSupergroupChatImpl(
@SerialName(slowModeDelayField) @SerialName(slowModeDelayField)
override val slowModeDelay: Long? = null, override val slowModeDelay: Long? = null,
@SerialName(canSetStickerSetField) @SerialName(canSetStickerSetField)
override val canSetStickerSet: Boolean = false override val canSetStickerSet: Boolean = false,
@SerialName(linkedChatIdField)
override val linkedChannelChatId: ChatId? = null,
@SerialName(locationField)
override val location: ChatLocation? = null
) : ExtendedSupergroupChat ) : ExtendedSupergroupChat