From 679f282bd249e503382f01b6d0082adb224bf67e Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 6 Feb 2020 23:28:46 +0600 Subject: [PATCH] refactor delete extensions --- .../TelegramBotAPI/requests/DeleteMessage.kt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/DeleteMessage.kt b/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/DeleteMessage.kt index 42c8b8bbed..a7df40851a 100644 --- a/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/DeleteMessage.kt +++ b/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/DeleteMessage.kt @@ -37,11 +37,9 @@ suspend fun RequestsExecutor.deleteMessage( ) = deleteMessage(chat.id, messageId) suspend fun RequestsExecutor.deleteMessage( - chatId: ChatId, message: Message -) = deleteMessage(chatId, message.messageId) +) = deleteMessage(message.chat, message.messageId) -suspend fun RequestsExecutor.deleteMessage( - chat: Chat, - message: Message -) = deleteMessage(chat.id, message.messageId) +suspend fun Message.delete( + requestsExecutor: RequestsExecutor +) = requestsExecutor.deleteMessage(this)