From 1d1ac9040c665b68f99ef14de0b9c3ea1e41a167 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 17 Feb 2019 14:40:43 +0800 Subject: [PATCH] MediaGroupList extensions --- CHANGELOG.md | 2 ++ .../TelegramBotAPI/utils/MediaGroupList.kt | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/MediaGroupList.kt diff --git a/CHANGELOG.md b/CHANGELOG.md index f045e67d05..6450cf3b2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ * Change algorithm of `executeUnsafe`: now it use loop instead of recursive calling * Add additional `startGettingUpdates` with better management of received updates for media groups * Now `MediaGroupMessage` is `CommonMessage` with `MediaGroupContent` content +* Added extensions `replyTo`, `forwarded` and `chat` for `List.forwarded: ForwardedMessage? + get() = first().let { + (it as? AbleToBeForwardedMessage) ?.forwarded + } + +val List.replyTo: Message? + get() = first().let { + (it as? AbleToReplyMessage) ?.replyTo + } + +val List.chat: Chat? + get() = first().data.chat