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

update Chat dependency in methods

This commit is contained in:
InsanusMokrassar 2020-02-06 13:38:52 +06:00
parent de1d6aa70c
commit 2cfabb1c2a
19 changed files with 45 additions and 26 deletions

View File

@ -5,6 +5,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PublicChat
import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField
import kotlinx.serialization.* import kotlinx.serialization.*
import kotlinx.serialization.internal.StringSerializer import kotlinx.serialization.internal.StringSerializer
@ -26,5 +27,5 @@ suspend fun RequestsExecutor.exportChatInviteLink(
) = execute(ExportChatInviteLink(chatId)) ) = execute(ExportChatInviteLink(chatId))
suspend fun RequestsExecutor.exportChatInviteLink( suspend fun RequestsExecutor.exportChatInviteLink(
chat: Chat chat: PublicChat
) = exportChatInviteLink(chat.id) ) = exportChatInviteLink(chat.id)

View File

@ -5,6 +5,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PublicChat
import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField
import kotlinx.serialization.* import kotlinx.serialization.*
import kotlinx.serialization.internal.BooleanSerializer import kotlinx.serialization.internal.BooleanSerializer
@ -26,5 +27,5 @@ suspend fun RequestsExecutor.leaveChat(
) = execute(LeaveChat(chatId)) ) = execute(LeaveChat(chatId))
suspend fun RequestsExecutor.leaveChat( suspend fun RequestsExecutor.leaveChat(
chat: Chat chat: PublicChat
) = leaveChat(chat.id) ) = leaveChat(chat.id)

View File

@ -7,6 +7,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatMember.abstracts.AdministratorChatMember import com.github.insanusmokrassar.TelegramBotAPI.types.ChatMember.abstracts.AdministratorChatMember
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatMember.abstracts.AdministratorChatMemberSerializerWithoutDeserialization import com.github.insanusmokrassar.TelegramBotAPI.types.ChatMember.abstracts.AdministratorChatMemberSerializerWithoutDeserialization
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PublicChat
import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField
import kotlinx.serialization.* import kotlinx.serialization.*
import kotlinx.serialization.internal.ArrayListSerializer import kotlinx.serialization.internal.ArrayListSerializer
@ -32,5 +33,5 @@ suspend fun RequestsExecutor.getChatAdministrators(
) = execute(GetChatAdministrators(chatId)) ) = execute(GetChatAdministrators(chatId))
suspend fun RequestsExecutor.getChatAdministrators( suspend fun RequestsExecutor.getChatAdministrators(
chat: Chat chat: PublicChat
) = getChatAdministrators(chat.id) ) = getChatAdministrators(chat.id)

View File

@ -5,6 +5,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PublicChat
import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField
import kotlinx.serialization.* import kotlinx.serialization.*
import kotlinx.serialization.internal.IntSerializer import kotlinx.serialization.internal.IntSerializer
@ -26,5 +27,5 @@ suspend fun RequestsExecutor.getChatMembersCount(
) = execute(GetChatMembersCount(chatId)) ) = execute(GetChatMembersCount(chatId))
suspend fun RequestsExecutor.getChatMembersCount( suspend fun RequestsExecutor.getChatMembersCount(
chat: Chat chat: PublicChat
) = getChatMembersCount(chat.id) ) = getChatMembersCount(chat.id)

View File

@ -7,6 +7,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatMember.abstracts.ChatMember import com.github.insanusmokrassar.TelegramBotAPI.types.ChatMember.abstracts.ChatMember
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatMember.abstracts.ChatMemberDeserializationStrategy import com.github.insanusmokrassar.TelegramBotAPI.types.ChatMember.abstracts.ChatMemberDeserializationStrategy
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PublicChat
import kotlinx.serialization.* import kotlinx.serialization.*
@Serializable @Serializable
@ -29,7 +30,7 @@ suspend fun RequestsExecutor.getChatMember(
) = execute(GetChatMember(chatId, userId)) ) = execute(GetChatMember(chatId, userId))
suspend fun RequestsExecutor.getChatMember( suspend fun RequestsExecutor.getChatMember(
chat: Chat, chat: PublicChat,
userId: UserId userId: UserId
) = getChatMember(chat.id, userId) ) = getChatMember(chat.id, userId)
@ -39,6 +40,6 @@ suspend fun RequestsExecutor.getChatMember(
) = getChatMember(chatId, user.id) ) = getChatMember(chatId, user.id)
suspend fun RequestsExecutor.getChatMember( suspend fun RequestsExecutor.getChatMember(
chat: Chat, chat: PublicChat,
user: User user: User
) = getChatMember(chat.id, user.id) ) = getChatMember(chat.id, user.id)

View File

@ -5,6 +5,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor
import com.github.insanusmokrassar.TelegramBotAPI.requests.chat.abstracts.ChatMemberRequest import com.github.insanusmokrassar.TelegramBotAPI.requests.chat.abstracts.ChatMemberRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PublicChat
import kotlinx.serialization.* import kotlinx.serialization.*
import kotlinx.serialization.internal.BooleanSerializer import kotlinx.serialization.internal.BooleanSerializer
@ -31,7 +32,7 @@ suspend fun RequestsExecutor.kickChatMember(
) = execute(KickChatMember(chatId, userId, untilDate)) ) = execute(KickChatMember(chatId, userId, untilDate))
suspend fun RequestsExecutor.kickChatMember( suspend fun RequestsExecutor.kickChatMember(
chat: Chat, chat: PublicChat,
userId: UserId, userId: UserId,
untilDate: TelegramDate? = null untilDate: TelegramDate? = null
) = kickChatMember(chat.id, userId, untilDate) ) = kickChatMember(chat.id, userId, untilDate)
@ -43,7 +44,7 @@ suspend fun RequestsExecutor.kickChatMember(
) = kickChatMember(chatId, user.id, untilDate) ) = kickChatMember(chatId, user.id, untilDate)
suspend fun RequestsExecutor.kickChatMember( suspend fun RequestsExecutor.kickChatMember(
chat: Chat, chat: PublicChat,
user: User, user: User,
untilDate: TelegramDate? = null untilDate: TelegramDate? = null
) = kickChatMember(chat.id, user.id, untilDate) ) = kickChatMember(chat.id, user.id, untilDate)

View File

@ -5,6 +5,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor
import com.github.insanusmokrassar.TelegramBotAPI.requests.chat.abstracts.ChatMemberRequest import com.github.insanusmokrassar.TelegramBotAPI.requests.chat.abstracts.ChatMemberRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PublicChat
import kotlinx.serialization.* import kotlinx.serialization.*
import kotlinx.serialization.internal.BooleanSerializer import kotlinx.serialization.internal.BooleanSerializer
@ -69,7 +70,7 @@ suspend fun RequestsExecutor.promoteChatMember(
) )
suspend fun RequestsExecutor.promoteChatMember( suspend fun RequestsExecutor.promoteChatMember(
chat: Chat, chat: PublicChat,
userId: UserId, userId: UserId,
untilDate: TelegramDate? = null, untilDate: TelegramDate? = null,
canChangeInfo: Boolean? = null, canChangeInfo: Boolean? = null,
@ -121,7 +122,7 @@ suspend fun RequestsExecutor.promoteChatMember(
) )
suspend fun RequestsExecutor.promoteChatMember( suspend fun RequestsExecutor.promoteChatMember(
chat: Chat, chat: PublicChat,
user: User, user: User,
untilDate: TelegramDate? = null, untilDate: TelegramDate? = null,
canChangeInfo: Boolean? = null, canChangeInfo: Boolean? = null,

View File

@ -6,6 +6,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.requests.chat.abstracts.ChatMe
import com.github.insanusmokrassar.TelegramBotAPI.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.ChatPermissions import com.github.insanusmokrassar.TelegramBotAPI.types.chat.ChatPermissions
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PublicChat
import kotlinx.serialization.* import kotlinx.serialization.*
import kotlinx.serialization.internal.BooleanSerializer import kotlinx.serialization.internal.BooleanSerializer
@ -35,7 +36,7 @@ suspend fun RequestsExecutor.restrictChatMember(
) = execute(RestrictChatMember(chatId, userId, untilDate, permissions)) ) = execute(RestrictChatMember(chatId, userId, untilDate, permissions))
suspend fun RequestsExecutor.restrictChatMember( suspend fun RequestsExecutor.restrictChatMember(
chat: Chat, chat: PublicChat,
userId: UserId, userId: UserId,
untilDate: TelegramDate? = null, untilDate: TelegramDate? = null,
permissions: ChatPermissions = ChatPermissions() permissions: ChatPermissions = ChatPermissions()
@ -49,7 +50,7 @@ suspend fun RequestsExecutor.restrictChatMember(
) = restrictChatMember(chatId, user.id, untilDate, permissions) ) = restrictChatMember(chatId, user.id, untilDate, permissions)
suspend fun RequestsExecutor.restrictChatMember( suspend fun RequestsExecutor.restrictChatMember(
chat: Chat, chat: PublicChat,
user: User, user: User,
untilDate: TelegramDate? = null, untilDate: TelegramDate? = null,
permissions: ChatPermissions = ChatPermissions() permissions: ChatPermissions = ChatPermissions()

View File

@ -4,6 +4,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor
import com.github.insanusmokrassar.TelegramBotAPI.requests.chat.abstracts.ChatMemberRequest import com.github.insanusmokrassar.TelegramBotAPI.requests.chat.abstracts.ChatMemberRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PublicChat
import kotlinx.serialization.* import kotlinx.serialization.*
import kotlinx.serialization.internal.BooleanSerializer import kotlinx.serialization.internal.BooleanSerializer
@ -41,7 +42,7 @@ suspend fun RequestsExecutor.setChatAdministratorCustomTitle(
) = execute(SetChatAdministratorCustomTitle(chatId, userId, customTitle)) ) = execute(SetChatAdministratorCustomTitle(chatId, userId, customTitle))
suspend fun RequestsExecutor.setChatAdministratorCustomTitle( suspend fun RequestsExecutor.setChatAdministratorCustomTitle(
chat: Chat, chat: PublicChat,
userId: UserId, userId: UserId,
customTitle: String customTitle: String
) = setChatAdministratorCustomTitle(chat.id, userId, customTitle) ) = setChatAdministratorCustomTitle(chat.id, userId, customTitle)
@ -53,7 +54,7 @@ suspend fun RequestsExecutor.setChatAdministratorCustomTitle(
) = setChatAdministratorCustomTitle(chatId, user.id, customTitle) ) = setChatAdministratorCustomTitle(chatId, user.id, customTitle)
suspend fun RequestsExecutor.setChatAdministratorCustomTitle( suspend fun RequestsExecutor.setChatAdministratorCustomTitle(
chat: Chat, chat: PublicChat,
user: User, user: User,
customTitle: String customTitle: String
) = setChatAdministratorCustomTitle(chat.id, user.id, customTitle) ) = setChatAdministratorCustomTitle(chat.id, user.id, customTitle)

View File

@ -4,6 +4,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor
import com.github.insanusmokrassar.TelegramBotAPI.requests.chat.abstracts.ChatMemberRequest import com.github.insanusmokrassar.TelegramBotAPI.requests.chat.abstracts.ChatMemberRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PublicChat
import kotlinx.serialization.* import kotlinx.serialization.*
import kotlinx.serialization.internal.BooleanSerializer import kotlinx.serialization.internal.BooleanSerializer
@ -27,7 +28,7 @@ suspend fun RequestsExecutor.unbanChatMember(
) = execute(UnbanChatMember(chatId, userId)) ) = execute(UnbanChatMember(chatId, userId))
suspend fun RequestsExecutor.unbanChatMember( suspend fun RequestsExecutor.unbanChatMember(
chat: Chat, chat: PublicChat,
userId: UserId userId: UserId
) = unbanChatMember(chat.id, userId) ) = unbanChatMember(chat.id, userId)
@ -37,7 +38,7 @@ suspend fun RequestsExecutor.unbanChatMember(
) = unbanChatMember(chatId, user.id) ) = unbanChatMember(chatId, user.id)
suspend fun RequestsExecutor.unbanChatMember( suspend fun RequestsExecutor.unbanChatMember(
chat: Chat, chat: PublicChat,
user: User user: User
) = unbanChatMember(chat.id, user.id) ) = unbanChatMember(chat.id, user.id)

View File

@ -6,6 +6,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleReque
import com.github.insanusmokrassar.TelegramBotAPI.requests.chat.get.GetChat import com.github.insanusmokrassar.TelegramBotAPI.requests.chat.get.GetChat
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PublicChat
import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField
import kotlinx.serialization.* import kotlinx.serialization.*
import kotlinx.serialization.internal.BooleanSerializer import kotlinx.serialization.internal.BooleanSerializer
@ -27,5 +28,5 @@ suspend fun RequestsExecutor.deleteChatPhoto(
) = execute(DeleteChatPhoto(chatId)) ) = execute(DeleteChatPhoto(chatId))
suspend fun RequestsExecutor.deleteChatPhoto( suspend fun RequestsExecutor.deleteChatPhoto(
chat: Chat chat: PublicChat
) = deleteChatPhoto(chat.id) ) = deleteChatPhoto(chat.id)

View File

@ -5,6 +5,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PublicChat
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.Message import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.Message
import kotlinx.serialization.* import kotlinx.serialization.*
import kotlinx.serialization.internal.BooleanSerializer import kotlinx.serialization.internal.BooleanSerializer
@ -32,7 +33,7 @@ suspend fun RequestsExecutor.pinChatMessage(
) = execute(PinChatMessage(chatId, messageId, disableNotification)) ) = execute(PinChatMessage(chatId, messageId, disableNotification))
suspend fun RequestsExecutor.pinChatMessage( suspend fun RequestsExecutor.pinChatMessage(
chat: Chat, chat: PublicChat,
messageId: MessageIdentifier, messageId: MessageIdentifier,
disableNotification: Boolean = false disableNotification: Boolean = false
) = pinChatMessage(chat.id, messageId, disableNotification) ) = pinChatMessage(chat.id, messageId, disableNotification)
@ -44,7 +45,7 @@ suspend fun RequestsExecutor.pinChatMessage(
) = execute(PinChatMessage(chatId, message.messageId, disableNotification)) ) = execute(PinChatMessage(chatId, message.messageId, disableNotification))
suspend fun RequestsExecutor.pinChatMessage( suspend fun RequestsExecutor.pinChatMessage(
chat: Chat, chat: PublicChat,
message: Message, message: Message,
disableNotification: Boolean = false disableNotification: Boolean = false
) = pinChatMessage(chat.id, message.messageId, disableNotification) ) = pinChatMessage(chat.id, message.messageId, disableNotification)

View File

@ -5,6 +5,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PublicChat
import kotlinx.serialization.* import kotlinx.serialization.*
import kotlinx.serialization.internal.BooleanSerializer import kotlinx.serialization.internal.BooleanSerializer
@ -34,6 +35,6 @@ suspend fun RequestsExecutor.setChatDescription(
) = execute(SetChatDescription(chatId, description)) ) = execute(SetChatDescription(chatId, description))
suspend fun RequestsExecutor.setChatDescription( suspend fun RequestsExecutor.setChatDescription(
chat: Chat, chat: PublicChat,
description: String description: String
) = setChatDescription(chat.id, description) ) = setChatDescription(chat.id, description)

View File

@ -6,6 +6,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleReque
import com.github.insanusmokrassar.TelegramBotAPI.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.ChatPermissions import com.github.insanusmokrassar.TelegramBotAPI.types.chat.ChatPermissions
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PublicChat
import kotlinx.serialization.* import kotlinx.serialization.*
import kotlinx.serialization.internal.BooleanSerializer import kotlinx.serialization.internal.BooleanSerializer
@ -29,6 +30,6 @@ suspend fun RequestsExecutor.setChatPermissions(
) = execute(SetChatPermissions(chatId, permissions)) ) = execute(SetChatPermissions(chatId, permissions))
suspend fun RequestsExecutor.setChatPermissions( suspend fun RequestsExecutor.setChatPermissions(
chat: Chat, chat: PublicChat,
permissions: ChatPermissions permissions: ChatPermissions
) = setChatPermissions(chat.id, permissions) ) = setChatPermissions(chat.id, permissions)

View File

@ -7,6 +7,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.MultipartRe
import com.github.insanusmokrassar.TelegramBotAPI.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.ChatPermissions import com.github.insanusmokrassar.TelegramBotAPI.types.chat.ChatPermissions
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PublicChat
import com.github.insanusmokrassar.TelegramBotAPI.utils.toJson import com.github.insanusmokrassar.TelegramBotAPI.utils.toJson
import kotlinx.serialization.* import kotlinx.serialization.*
import kotlinx.serialization.internal.BooleanSerializer import kotlinx.serialization.internal.BooleanSerializer
@ -31,6 +32,6 @@ suspend fun RequestsExecutor.setChatPermissions(
) = execute(SetChatPhoto(chatId, photo)) ) = execute(SetChatPhoto(chatId, photo))
suspend fun RequestsExecutor.setChatPermissions( suspend fun RequestsExecutor.setChatPermissions(
chat: Chat, chat: PublicChat,
photo: MultipartFile photo: MultipartFile
) = setChatPermissions(chat.id, photo) ) = setChatPermissions(chat.id, photo)

View File

@ -6,6 +6,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.MultipartFi
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PublicChat
import kotlinx.serialization.* import kotlinx.serialization.*
import kotlinx.serialization.internal.BooleanSerializer import kotlinx.serialization.internal.BooleanSerializer
@ -35,6 +36,6 @@ suspend fun RequestsExecutor.setChatTitle(
) = execute(SetChatTitle(chatId, title)) ) = execute(SetChatTitle(chatId, title))
suspend fun RequestsExecutor.setChatTitle( suspend fun RequestsExecutor.setChatTitle(
chat: Chat, chat: PublicChat,
title: String title: String
) = setChatTitle(chat.id, title) ) = setChatTitle(chat.id, title)

View File

@ -5,6 +5,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PublicChat
import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField
import kotlinx.serialization.* import kotlinx.serialization.*
import kotlinx.serialization.internal.BooleanSerializer import kotlinx.serialization.internal.BooleanSerializer
@ -26,5 +27,5 @@ suspend fun RequestsExecutor.unpinChatMessage(
) = execute(UnpinChatMessage(chatId)) ) = execute(UnpinChatMessage(chatId))
suspend fun RequestsExecutor.unpinChatMessage( suspend fun RequestsExecutor.unpinChatMessage(
chat: Chat chat: PublicChat
) = unpinChatMessage(chat.id) ) = unpinChatMessage(chat.id)

View File

@ -6,6 +6,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleReque
import com.github.insanusmokrassar.TelegramBotAPI.requests.chat.modify.DeleteChatPhoto import com.github.insanusmokrassar.TelegramBotAPI.requests.chat.modify.DeleteChatPhoto
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PublicChat
import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField
import kotlinx.serialization.* import kotlinx.serialization.*
import kotlinx.serialization.internal.BooleanSerializer import kotlinx.serialization.internal.BooleanSerializer
@ -27,5 +28,5 @@ suspend fun RequestsExecutor.deleteChatStickerSet(
) = execute(DeleteChatStickerSet(chatId)) ) = execute(DeleteChatStickerSet(chatId))
suspend fun RequestsExecutor.deleteChatStickerSet( suspend fun RequestsExecutor.deleteChatStickerSet(
chat: Chat chat: PublicChat
) = deleteChatStickerSet(chat.id) ) = deleteChatStickerSet(chat.id)

View File

@ -5,6 +5,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PublicChat
import kotlinx.serialization.* import kotlinx.serialization.*
import kotlinx.serialization.internal.BooleanSerializer import kotlinx.serialization.internal.BooleanSerializer
@ -28,6 +29,6 @@ suspend fun RequestsExecutor.setChatStickerSet(
) = execute(SetChatStickerSet(chatId, stickerSetName)) ) = execute(SetChatStickerSet(chatId, stickerSetName))
suspend fun RequestsExecutor.setChatStickerSet( suspend fun RequestsExecutor.setChatStickerSet(
chat: Chat, chat: PublicChat,
stickerSetName: StickerSetName stickerSetName: StickerSetName
) = setChatStickerSet(chat.id, stickerSetName) ) = setChatStickerSet(chat.id, stickerSetName)