@microsoft/teams.cards
Version:
<p> <a href="https://www.npmjs.com/package/@microsoft/teams.cards" target="_blank"> <img src="https://img.shields.io/npm/v/@microsoft/teams.cards" /> </a> <a href="https://www.npmjs.com/package/@microsoft/teams.cards?activeTab=code" ta
56 lines (53 loc) • 1.42 kB
JavaScript
;
var submit = require('./submit');
class MessageBackAction extends submit.SubmitAction {
/**
* Initial data that input fields will be combined with. These are essentially ‘hidden’ properties.
*/
data;
constructor(data, options = {}) {
super(options);
Object.assign(this, options);
this.data = {
msteams: new MessageBackData(data.text, data.value, data.displayText)
};
}
static from(options) {
return new MessageBackAction(options.data.msteams, options);
}
withData(value) {
super.withData({ msteams: value });
return this;
}
}
class MessageBackData {
type;
/**
* Sent to your bot when the action is performed.
*/
text;
/**
* Used by the user in the chat stream when the action is performed.
* This text isn't sent to your bot.
*/
displayText;
/**
* Sent to your bot when the action is performed. You can encode context
* for the action, such as unique identifiers or a `JSON` object.
*/
value;
constructor(text, value, displayText) {
this.type = "messageBack";
this.text = text;
this.value = value;
this.displayText = displayText;
}
withDisplayText(value) {
this.displayText = value;
return this;
}
}
exports.MessageBackAction = MessageBackAction;
exports.MessageBackData = MessageBackData;
//# sourceMappingURL=message-back.js.map
//# sourceMappingURL=message-back.js.map