Skip to content

Commit

Permalink
Adding MessageFactory.text in Cards/index.js (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
karantrehan3 authored Apr 26, 2022
1 parent 38de2c1 commit ff30ad2
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions lib/Cards/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Cards {
* @param {Boolean} [rtl = false] works on v1.5 and later, when true content in this Adaptive Card should be presented right to left. defaults to false.
* @param {Boolean} [isFullWidth = true] sets the card width to full size if true. defaults to true
* @param {Array<object>} [entities = []] array of entities to be set inside msteams attribute
* @returns
* @returns {Attachment} adaptive card attachment
*/
adaptiveCard({
version = "1.3",
Expand Down Expand Up @@ -65,7 +65,7 @@ class Cards {
* Helper method to generate MessageFactory Attachment from adaptive card.
*
* @param {adaptiveCard} card adaptive card object
* @returns {object} MessageFactory Attachment
* @returns {Partial<Activity>} MessageFactory Attachment
*/
attachment(card) {
return MessageFactory.attachment(card);
Expand All @@ -75,11 +75,21 @@ class Cards {
* Helper method to generate MessageFactory Carousel from adaptive cards.
*
* @param {Array<adaptiveCard>} cards array of adaptive cards
* @returns {object} MessageFactory Attachment
* @returns {Partial<Activity>} MessageFactory Carousel
*/
carousel(cards) {
return MessageFactory.carousel(cards);
}

/**
* Helper method to generate MessageFactory Text from a String
*
* @param {String} messageText text to be displayed.
* @returns {Partial<Activity>} MessageFactory Text
*/
text(messageText) {
return MessageFactory.text(messageText);
}
}

module.exports = new Cards();

0 comments on commit ff30ad2

Please sign in to comment.