Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Commit 7aedcbc

Browse files
authoredApr 12, 2019
Merge pull request #1608 from ryansydnor/dialog-state
Add dialog state to Slackbot worker createDialog
2 parents 0d48db5 + d7bf82b commit 7aedcbc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed
 

‎lib/Slackbot_worker.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -655,14 +655,15 @@ module.exports = function(botkit, config) {
655655

656656

657657
/* helper functions for creating dialog attachments */
658-
bot.createDialog = function(title, callback_id, submit_label, elements) {
658+
bot.createDialog = function(title, callback_id, submit_label, elements, stateString) {
659659

660660
var obj = {
661661
data: {
662662
title: title,
663663
callback_id: callback_id,
664664
submit_label: submit_label || null,
665665
elements: elements || [],
666+
state: stateString,
666667
},
667668
title: function(v) {
668669
this.data.title = v;
@@ -676,6 +677,10 @@ module.exports = function(botkit, config) {
676677
this.data.submit_label = v;
677678
return this;
678679
},
680+
state: function(stateStr) {
681+
this.data.state = stateStr;
682+
return this;
683+
},
679684
addText: function(label, name, value, options, subtype) {
680685

681686
var element = (typeof(label) === 'object') ? label : {

0 commit comments

Comments
 (0)
This repository has been archived.