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

Commit

Permalink
Add dialog state to Slackbot worker createDialog
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansydnor committed Mar 18, 2019
1 parent 1623726 commit d7bf82b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/Slackbot_worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -655,14 +655,15 @@ module.exports = function(botkit, config) {


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

var obj = {
data: {
title: title,
callback_id: callback_id,
submit_label: submit_label || null,
elements: elements || [],
state: stateString,
},
title: function(v) {
this.data.title = v;
Expand All @@ -676,6 +677,10 @@ module.exports = function(botkit, config) {
this.data.submit_label = v;
return this;
},
state: function(stateStr) {
this.data.state = stateStr;
return this;
},
addText: function(label, name, value, options, subtype) {

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

0 comments on commit d7bf82b

Please sign in to comment.