Skip to content

Commit

Permalink
Merge pull request #18 from QuasarApp/minor_fixes
Browse files Browse the repository at this point in the history
added fullText method of TelegramMessage
  • Loading branch information
EndrII authored Nov 27, 2024
2 parents 9547b0c + dd6eb8b commit ee6949a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/qTbot/src/public/qTbot/messages/telegrammsg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
12 changes: 12 additions & 0 deletions src/qTbot/src/public/qTbot/messages/telegrammsg.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ee6949a

Please sign in to comment.