mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-22 08:13:47 +00:00
ChatAdministratorRightsImpl -> ChatCommonAdministratorRights
This commit is contained in:
parent
73a748d8b3
commit
affa2a3a57
@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
## 9.2.0
|
## 9.2.0
|
||||||
|
|
||||||
* All the request chat keyboards has changed their parameters `ChatAdministratorRights` to `ChatAdministratorRightsImpl`
|
* Rename `ChatAdministratorRightsImpl` -> `ChatCommonAdministratorRights`
|
||||||
|
* All the request chat keyboards has changed their parameters `ChatAdministratorRights` to `ChatCommonAdministratorRights`
|
||||||
|
|
||||||
## 9.1.2
|
## 9.1.2
|
||||||
|
|
||||||
|
@ -2,17 +2,17 @@ package dev.inmo.tgbotapi.extensions.api.bot
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.bot.SetMyDefaultAdministratorRights
|
import dev.inmo.tgbotapi.requests.bot.SetMyDefaultAdministratorRights
|
||||||
import dev.inmo.tgbotapi.types.chat.member.ChatAdministratorRightsImpl
|
import dev.inmo.tgbotapi.types.chat.member.ChatCommonAdministratorRights
|
||||||
|
|
||||||
suspend fun TelegramBot.setMyDefaultAdministratorRights(
|
suspend fun TelegramBot.setMyDefaultAdministratorRights(
|
||||||
rights: ChatAdministratorRightsImpl,
|
rights: ChatCommonAdministratorRights,
|
||||||
forChannels: Boolean? = null
|
forChannels: Boolean? = null
|
||||||
) = execute(SetMyDefaultAdministratorRights(rights, forChannels))
|
) = execute(SetMyDefaultAdministratorRights(rights, forChannels))
|
||||||
|
|
||||||
suspend fun TelegramBot.setMyDefaultAdministratorRightsForChannels(
|
suspend fun TelegramBot.setMyDefaultAdministratorRightsForChannels(
|
||||||
rights: ChatAdministratorRightsImpl
|
rights: ChatCommonAdministratorRights
|
||||||
) = setMyDefaultAdministratorRights(rights, forChannels = true)
|
) = setMyDefaultAdministratorRights(rights, forChannels = true)
|
||||||
|
|
||||||
suspend fun TelegramBot.setMyDefaultAdministratorRightsForGroupsAndSupergroups(
|
suspend fun TelegramBot.setMyDefaultAdministratorRightsForGroupsAndSupergroups(
|
||||||
rights: ChatAdministratorRightsImpl
|
rights: ChatCommonAdministratorRights
|
||||||
) = setMyDefaultAdministratorRights(rights, forChannels = false)
|
) = setMyDefaultAdministratorRights(rights, forChannels = false)
|
||||||
|
@ -2,14 +2,14 @@ package dev.inmo.tgbotapi.requests.bot
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
|
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
import dev.inmo.tgbotapi.types.chat.member.ChatAdministratorRightsImpl
|
import dev.inmo.tgbotapi.types.chat.member.ChatCommonAdministratorRights
|
||||||
import kotlinx.serialization.*
|
import kotlinx.serialization.*
|
||||||
import kotlinx.serialization.builtins.serializer
|
import kotlinx.serialization.builtins.serializer
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
class SetMyDefaultAdministratorRights(
|
class SetMyDefaultAdministratorRights(
|
||||||
@SerialName(rightsField)
|
@SerialName(rightsField)
|
||||||
val rights: ChatAdministratorRightsImpl,
|
val rights: ChatCommonAdministratorRights,
|
||||||
@SerialName(forChannelsField)
|
@SerialName(forChannelsField)
|
||||||
val forChannels: Boolean? = null
|
val forChannels: Boolean? = null
|
||||||
) : SimpleRequest<Boolean> {
|
) : SimpleRequest<Boolean> {
|
||||||
|
@ -2,8 +2,7 @@ package dev.inmo.tgbotapi.types.buttons
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.types.botAdministratorRightsField
|
import dev.inmo.tgbotapi.types.botAdministratorRightsField
|
||||||
import dev.inmo.tgbotapi.types.botIsMemberField
|
import dev.inmo.tgbotapi.types.botIsMemberField
|
||||||
import dev.inmo.tgbotapi.types.chat.member.ChatAdministratorRights
|
import dev.inmo.tgbotapi.types.chat.member.ChatCommonAdministratorRights
|
||||||
import dev.inmo.tgbotapi.types.chat.member.ChatAdministratorRightsImpl
|
|
||||||
import dev.inmo.tgbotapi.types.chatHasUsernameField
|
import dev.inmo.tgbotapi.types.chatHasUsernameField
|
||||||
import dev.inmo.tgbotapi.types.chatIsChannelField
|
import dev.inmo.tgbotapi.types.chatIsChannelField
|
||||||
import dev.inmo.tgbotapi.types.chatIsCreatedField
|
import dev.inmo.tgbotapi.types.chatIsCreatedField
|
||||||
@ -31,9 +30,9 @@ data class KeyboardButtonRequestChat(
|
|||||||
@SerialName(chatIsCreatedField)
|
@SerialName(chatIsCreatedField)
|
||||||
val isOwnedBy: Boolean? = null,
|
val isOwnedBy: Boolean? = null,
|
||||||
@SerialName(userAdministratorRightsField)
|
@SerialName(userAdministratorRightsField)
|
||||||
val userRightsInChat: ChatAdministratorRightsImpl? = null,
|
val userRightsInChat: ChatCommonAdministratorRights? = null,
|
||||||
@SerialName(botAdministratorRightsField)
|
@SerialName(botAdministratorRightsField)
|
||||||
val botRightsInChat: ChatAdministratorRightsImpl? = null,
|
val botRightsInChat: ChatCommonAdministratorRights? = null,
|
||||||
@SerialName(botIsMemberField)
|
@SerialName(botIsMemberField)
|
||||||
val botIsMember: Boolean? = null
|
val botIsMember: Boolean? = null
|
||||||
) {
|
) {
|
||||||
@ -42,8 +41,8 @@ data class KeyboardButtonRequestChat(
|
|||||||
requestId: RequestId,
|
requestId: RequestId,
|
||||||
isPublic: Boolean? = null,
|
isPublic: Boolean? = null,
|
||||||
isOwnedBy: Boolean? = null,
|
isOwnedBy: Boolean? = null,
|
||||||
userRightsInChat: ChatAdministratorRightsImpl? = null,
|
userRightsInChat: ChatCommonAdministratorRights? = null,
|
||||||
botRightsInChat: ChatAdministratorRightsImpl? = null,
|
botRightsInChat: ChatCommonAdministratorRights? = null,
|
||||||
botIsMember: Boolean? = null
|
botIsMember: Boolean? = null
|
||||||
) = KeyboardButtonRequestChat(
|
) = KeyboardButtonRequestChat(
|
||||||
requestId = requestId,
|
requestId = requestId,
|
||||||
@ -61,8 +60,8 @@ data class KeyboardButtonRequestChat(
|
|||||||
isForum: Boolean? = null,
|
isForum: Boolean? = null,
|
||||||
isPublic: Boolean? = null,
|
isPublic: Boolean? = null,
|
||||||
isOwnedBy: Boolean? = null,
|
isOwnedBy: Boolean? = null,
|
||||||
userRightsInChat: ChatAdministratorRightsImpl? = null,
|
userRightsInChat: ChatCommonAdministratorRights? = null,
|
||||||
botRightsInChat: ChatAdministratorRightsImpl? = null,
|
botRightsInChat: ChatCommonAdministratorRights? = null,
|
||||||
botIsMember: Boolean? = null
|
botIsMember: Boolean? = null
|
||||||
) = KeyboardButtonRequestChat(
|
) = KeyboardButtonRequestChat(
|
||||||
requestId = requestId,
|
requestId = requestId,
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
package dev.inmo.tgbotapi.types.buttons.reply
|
package dev.inmo.tgbotapi.types.buttons.reply
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.types.buttons.*
|
import dev.inmo.tgbotapi.types.buttons.*
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.*
|
import dev.inmo.tgbotapi.types.chat.member.ChatCommonAdministratorRights
|
||||||
import dev.inmo.tgbotapi.types.chat.member.ChatAdministratorRightsImpl
|
|
||||||
import dev.inmo.tgbotapi.types.request.RequestId
|
import dev.inmo.tgbotapi.types.request.RequestId
|
||||||
import dev.inmo.tgbotapi.types.webapps.WebAppInfo
|
import dev.inmo.tgbotapi.types.webapps.WebAppInfo
|
||||||
|
|
||||||
@ -120,8 +119,8 @@ inline fun requestChatReplyButton(
|
|||||||
isForum: Boolean? = null,
|
isForum: Boolean? = null,
|
||||||
isPublic: Boolean? = null,
|
isPublic: Boolean? = null,
|
||||||
isOwnedBy: Boolean? = null,
|
isOwnedBy: Boolean? = null,
|
||||||
userRightsInChat: ChatAdministratorRightsImpl? = null,
|
userRightsInChat: ChatCommonAdministratorRights? = null,
|
||||||
botRightsInChat: ChatAdministratorRightsImpl? = null,
|
botRightsInChat: ChatCommonAdministratorRights? = null,
|
||||||
botIsMember: Boolean = false
|
botIsMember: Boolean = false
|
||||||
) = requestChatReplyButton(
|
) = requestChatReplyButton(
|
||||||
text,
|
text,
|
||||||
@ -145,8 +144,8 @@ inline fun requestChannelReplyButton(
|
|||||||
requestId: RequestId,
|
requestId: RequestId,
|
||||||
isPublic: Boolean? = null,
|
isPublic: Boolean? = null,
|
||||||
isOwnedBy: Boolean? = null,
|
isOwnedBy: Boolean? = null,
|
||||||
userRightsInChat: ChatAdministratorRightsImpl? = null,
|
userRightsInChat: ChatCommonAdministratorRights? = null,
|
||||||
botRightsInChat: ChatAdministratorRightsImpl? = null,
|
botRightsInChat: ChatCommonAdministratorRights? = null,
|
||||||
botIsMember: Boolean = false
|
botIsMember: Boolean = false
|
||||||
) = requestChatReplyButton(
|
) = requestChatReplyButton(
|
||||||
text,
|
text,
|
||||||
@ -170,8 +169,8 @@ inline fun requestChannelReplyButton(
|
|||||||
isForum: Boolean? = null,
|
isForum: Boolean? = null,
|
||||||
isPublic: Boolean? = null,
|
isPublic: Boolean? = null,
|
||||||
isOwnedBy: Boolean? = null,
|
isOwnedBy: Boolean? = null,
|
||||||
userRightsInChat: ChatAdministratorRightsImpl? = null,
|
userRightsInChat: ChatCommonAdministratorRights? = null,
|
||||||
botRightsInChat: ChatAdministratorRightsImpl? = null,
|
botRightsInChat: ChatCommonAdministratorRights? = null,
|
||||||
botIsMember: Boolean? = null
|
botIsMember: Boolean? = null
|
||||||
) = requestChatReplyButton(
|
) = requestChatReplyButton(
|
||||||
text,
|
text,
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
package dev.inmo.tgbotapi.types.chat.member
|
package dev.inmo.tgbotapi.types.chat.member
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.types.*
|
|
||||||
import kotlinx.serialization.SerialName
|
|
||||||
|
|
||||||
sealed interface SpecialChatAdministratorRights {
|
sealed interface SpecialChatAdministratorRights {
|
||||||
val canChangeInfo: Boolean
|
val canChangeInfo: Boolean
|
||||||
val canInviteUsers: Boolean
|
val canInviteUsers: Boolean
|
||||||
@ -40,7 +37,7 @@ sealed interface ChatAdministratorRights : SpecialChatAdministratorRights {
|
|||||||
canPostStories: Boolean = false,
|
canPostStories: Boolean = false,
|
||||||
canEditStories: Boolean = false,
|
canEditStories: Boolean = false,
|
||||||
canDeleteStories: Boolean = false
|
canDeleteStories: Boolean = false
|
||||||
) = ChatAdministratorRightsImpl(
|
) = ChatCommonAdministratorRights(
|
||||||
canChangeInfo = canChangeInfo,
|
canChangeInfo = canChangeInfo,
|
||||||
canPostMessages = canPostMessages,
|
canPostMessages = canPostMessages,
|
||||||
canEditMessages = canEditMessages,
|
canEditMessages = canEditMessages,
|
||||||
|
@ -5,7 +5,7 @@ import kotlinx.serialization.SerialName
|
|||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class ChatAdministratorRightsImpl(
|
data class ChatCommonAdministratorRights(
|
||||||
@SerialName(canChangeInfoField)
|
@SerialName(canChangeInfoField)
|
||||||
override val canChangeInfo: Boolean = false,
|
override val canChangeInfo: Boolean = false,
|
||||||
@SerialName(canPostMessagesField)
|
@SerialName(canPostMessagesField)
|
||||||
@ -37,3 +37,12 @@ data class ChatAdministratorRightsImpl(
|
|||||||
@SerialName(canDeleteStoriesField)
|
@SerialName(canDeleteStoriesField)
|
||||||
override val canDeleteStories: Boolean = false
|
override val canDeleteStories: Boolean = false
|
||||||
) : ChatAdministratorRights
|
) : ChatAdministratorRights
|
||||||
|
|
||||||
|
@Deprecated(
|
||||||
|
"Renamed to ChatCommonAdministratorRights and will be removed soon",
|
||||||
|
ReplaceWith(
|
||||||
|
"ChatCommonAdministratorRights",
|
||||||
|
"dev.inmo.tgbotapi.types.chat.member.ChatCommonAdministratorRights"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
typealias ChatAdministratorRightsImpl = ChatCommonAdministratorRights
|
@ -3,7 +3,7 @@ package dev.inmo.tgbotapi.extensions.utils.types.buttons
|
|||||||
import dev.inmo.tgbotapi.types.buttons.*
|
import dev.inmo.tgbotapi.types.buttons.*
|
||||||
import dev.inmo.tgbotapi.types.buttons.reply.requestChatReplyButton
|
import dev.inmo.tgbotapi.types.buttons.reply.requestChatReplyButton
|
||||||
import dev.inmo.tgbotapi.types.buttons.reply.requestUserReplyButton
|
import dev.inmo.tgbotapi.types.buttons.reply.requestUserReplyButton
|
||||||
import dev.inmo.tgbotapi.types.chat.member.ChatAdministratorRightsImpl
|
import dev.inmo.tgbotapi.types.chat.member.ChatCommonAdministratorRights
|
||||||
import dev.inmo.tgbotapi.types.request.RequestId
|
import dev.inmo.tgbotapi.types.request.RequestId
|
||||||
import dev.inmo.tgbotapi.types.webapps.WebAppInfo
|
import dev.inmo.tgbotapi.types.webapps.WebAppInfo
|
||||||
import dev.inmo.tgbotapi.utils.*
|
import dev.inmo.tgbotapi.utils.*
|
||||||
@ -220,8 +220,8 @@ inline fun ReplyKeyboardRowBuilder.requestChatButton(
|
|||||||
isForum: Boolean? = null,
|
isForum: Boolean? = null,
|
||||||
isPublic: Boolean? = null,
|
isPublic: Boolean? = null,
|
||||||
isOwnedBy: Boolean? = null,
|
isOwnedBy: Boolean? = null,
|
||||||
userRightsInChat: ChatAdministratorRightsImpl? = null,
|
userRightsInChat: ChatCommonAdministratorRights? = null,
|
||||||
botRightsInChat: ChatAdministratorRightsImpl? = null,
|
botRightsInChat: ChatCommonAdministratorRights? = null,
|
||||||
botIsMember: Boolean? = null
|
botIsMember: Boolean? = null
|
||||||
) = requestChatButton(
|
) = requestChatButton(
|
||||||
text,
|
text,
|
||||||
@ -248,8 +248,8 @@ inline fun ReplyKeyboardRowBuilder.requestChannelButton(
|
|||||||
requestId: RequestId,
|
requestId: RequestId,
|
||||||
isPublic: Boolean? = null,
|
isPublic: Boolean? = null,
|
||||||
isOwnedBy: Boolean? = null,
|
isOwnedBy: Boolean? = null,
|
||||||
userRightsInChat: ChatAdministratorRightsImpl? = null,
|
userRightsInChat: ChatCommonAdministratorRights? = null,
|
||||||
botRightsInChat: ChatAdministratorRightsImpl? = null,
|
botRightsInChat: ChatCommonAdministratorRights? = null,
|
||||||
botIsMember: Boolean? = null
|
botIsMember: Boolean? = null
|
||||||
) = requestChatButton(
|
) = requestChatButton(
|
||||||
text,
|
text,
|
||||||
@ -275,8 +275,8 @@ inline fun ReplyKeyboardRowBuilder.requestGroupButton(
|
|||||||
isForum: Boolean? = null,
|
isForum: Boolean? = null,
|
||||||
isPublic: Boolean? = null,
|
isPublic: Boolean? = null,
|
||||||
isOwnedBy: Boolean? = null,
|
isOwnedBy: Boolean? = null,
|
||||||
userRightsInChat: ChatAdministratorRightsImpl? = null,
|
userRightsInChat: ChatCommonAdministratorRights? = null,
|
||||||
botRightsInChat: ChatAdministratorRightsImpl? = null,
|
botRightsInChat: ChatCommonAdministratorRights? = null,
|
||||||
botIsMember: Boolean? = null
|
botIsMember: Boolean? = null
|
||||||
) = requestChatButton(
|
) = requestChatButton(
|
||||||
text,
|
text,
|
||||||
|
Loading…
Reference in New Issue
Block a user