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

Commit

Permalink
Merge pull request #1608 from ryansydnor/dialog-state
Browse files Browse the repository at this point in the history
Add dialog state to Slackbot worker createDialog
  • Loading branch information
benbrown authored Apr 12, 2019
2 parents 0d48db5 + d7bf82b commit 7aedcbc
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 7aedcbc

Please sign in to comment.