diff --git a/src/qTbot/src/public/qTbot/messages/telegrammsg.cpp b/src/qTbot/src/public/qTbot/messages/telegrammsg.cpp index 269892c..9a34ef0 100644 --- a/src/qTbot/src/public/qTbot/messages/telegrammsg.cpp +++ b/src/qTbot/src/public/qTbot/messages/telegrammsg.cpp @@ -84,6 +84,14 @@ QString TelegramMsg::text() const { return rawJson()["text"].toString(); } +QString TelegramMsg::fullText() const { + return rawJson()["text"].toString() + rawJson()["caption"].toString(); +} + +QString TelegramMsg::caption() const { + return rawJson()["caption"].toString(); +} + bool TelegramMsg::contains(const Type &type) { return rawJson().contains(type); } diff --git a/src/qTbot/src/public/qTbot/messages/telegrammsg.h b/src/qTbot/src/public/qTbot/messages/telegrammsg.h index 70d6f08..4bf24b3 100644 --- a/src/qTbot/src/public/qTbot/messages/telegrammsg.h +++ b/src/qTbot/src/public/qTbot/messages/telegrammsg.h @@ -169,6 +169,18 @@ class QTBOT_EXPORT TelegramMsg: public iMessage */ QString text() const; + /** + * @brief fullText return text + caption value + * @return text + caption value + */ + QString fullText() const; + + /** + * @brief caption return only caption value + * @return only caption value + */ + QString caption() const; + /** * @brief contains This method returns true if the message contains choosed data type. * @param type This is name of the type