Skip to content

Commit ff30ad2

Browse files
authored
Adding MessageFactory.text in Cards/index.js (#5)
1 parent 38de2c1 commit ff30ad2

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

lib/Cards/index.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Cards {
1919
* @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.
2020
* @param {Boolean} [isFullWidth = true] sets the card width to full size if true. defaults to true
2121
* @param {Array<object>} [entities = []] array of entities to be set inside msteams attribute
22-
* @returns
22+
* @returns {Attachment} adaptive card attachment
2323
*/
2424
adaptiveCard({
2525
version = "1.3",
@@ -65,7 +65,7 @@ class Cards {
6565
* Helper method to generate MessageFactory Attachment from adaptive card.
6666
*
6767
* @param {adaptiveCard} card adaptive card object
68-
* @returns {object} MessageFactory Attachment
68+
* @returns {Partial<Activity>} MessageFactory Attachment
6969
*/
7070
attachment(card) {
7171
return MessageFactory.attachment(card);
@@ -75,11 +75,21 @@ class Cards {
7575
* Helper method to generate MessageFactory Carousel from adaptive cards.
7676
*
7777
* @param {Array<adaptiveCard>} cards array of adaptive cards
78-
* @returns {object} MessageFactory Attachment
78+
* @returns {Partial<Activity>} MessageFactory Carousel
7979
*/
8080
carousel(cards) {
8181
return MessageFactory.carousel(cards);
8282
}
83+
84+
/**
85+
* Helper method to generate MessageFactory Text from a String
86+
*
87+
* @param {String} messageText text to be displayed.
88+
* @returns {Partial<Activity>} MessageFactory Text
89+
*/
90+
text(messageText) {
91+
return MessageFactory.text(messageText);
92+
}
8393
}
8494

8595
module.exports = new Cards();

0 commit comments

Comments
 (0)