Skip to content

Commit

Permalink
try number 3
Browse files Browse the repository at this point in the history
  • Loading branch information
arinehouse committed Mar 28, 2017
1 parent b7be3c1 commit 588fc93
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import botkit from 'botkit';
const controller = botkit.slackbot({
debug: false,
});

var pubChannels = [];
var specChannel;

Expand Down Expand Up @@ -40,9 +39,9 @@ controller.hears(['help'], ['direct_message', 'direct_mention', 'mention'], (bot

controller.hears(['post'], ['direct_message'], (bot, message) => {
bot.startConversation(message, (err, convo) => {
convo.ask('Sure! Where do you want to post? (Don\'t include the # symbol)', (resp, conv) => {
convo.ask('Sure! Where do you want to post? (Don\'t include the # symbol)', (response, conversation) => {
pubChannels.forEach((channel) => {
if (channel.name === resp) { specChannel = channel; }
if (channel.name === response) { specChannel = channel; }
});
});
convo.ask('Okay! What do you want to post to #' + specChannel.name + '?', (response, conversation) => {
Expand Down

0 comments on commit 588fc93

Please sign in to comment.