added fullText method of TelegramMessage

This commit is contained in:
Andrei Yankovich 2024-11-27 19:31:44 +01:00
parent 9547b0c503
commit dd6eb8b815
2 changed files with 20 additions and 0 deletions

View File

@ -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);
}

View File

@ -169,6 +169,18 @@ public:
*/
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