1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-12-23 09:07:12 +00:00

LeaveChat and ExportChatInviteLink now have one more extension

This commit is contained in:
InsanusMokrassar 2020-02-06 13:31:53 +06:00
parent 90d5833021
commit de1d6aa70c
2 changed files with 10 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequ
import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField
import kotlinx.serialization.*
import kotlinx.serialization.internal.StringSerializer
@ -23,3 +24,7 @@ data class ExportChatInviteLink(
suspend fun RequestsExecutor.exportChatInviteLink(
chatId: ChatIdentifier
) = execute(ExportChatInviteLink(chatId))
suspend fun RequestsExecutor.exportChatInviteLink(
chat: Chat
) = exportChatInviteLink(chat.id)

View File

@ -4,6 +4,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequ
import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
import com.github.insanusmokrassar.TelegramBotAPI.types.chatIdField
import kotlinx.serialization.*
import kotlinx.serialization.internal.BooleanSerializer
@ -23,3 +24,7 @@ data class LeaveChat(
suspend fun RequestsExecutor.leaveChat(
chatId: ChatIdentifier
) = execute(LeaveChat(chatId))
suspend fun RequestsExecutor.leaveChat(
chat: Chat
) = leaveChat(chat.id)