mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-12-23 17:17:13 +00:00
LeaveChat and ExportChatInviteLink now have one more extension
This commit is contained in:
parent
90d5833021
commit
de1d6aa70c
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user