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

Commit

Permalink
linter
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Brown committed Feb 14, 2018
1 parent 597c6ad commit 254cb3d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion lib/CiscoSparkbot.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ function Sparkbot(configuration) {

}
}).catch(function(err) {
throw new Error(err);
throw new Error(err);
});
};

Expand Down
32 changes: 16 additions & 16 deletions lib/TwilioIPMBot.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ function Twiliobot(configuration) {
utterances: botkit.utterances,
};

bot.send = function (message, cb) {
bot.send = function(message, cb) {
botkit.debug('SEND ', message);

bot.api.channels(message.channel).messages.create(message)
.then(function (response) {
.then(function(response) {
cb(null, response);
}).catch(function (err) {
}).catch(function(err) {
cb(err);
});
};
Expand Down Expand Up @@ -167,7 +167,7 @@ function Twiliobot(configuration) {
return twilio_botkit;
};

twilio_botkit.handleWebhookPayload = function (req, res, bot) {
twilio_botkit.handleWebhookPayload = function(req, res, bot) {
var message = req.body;
twilio_botkit.ingest(bot, message, res);
};
Expand Down Expand Up @@ -220,7 +220,7 @@ function Twiliobot(configuration) {
var channels = bot.channels;

// if its not in a channel with the bot
var apprChan = channels.filter(function (ch) {
var apprChan = channels.filter(function(ch) {
return ch.sid === message.channel;
});

Expand All @@ -235,7 +235,7 @@ function Twiliobot(configuration) {

if (bot.identity && message.user === bot.identity) {
// remove that channel from bot.channels.channels
var chan_to_rem = bot.channels.map(function (ch) {
var chan_to_rem = bot.channels.map(function(ch) {
return ch.sid;
}).indexOf(message.channel);

Expand All @@ -249,7 +249,7 @@ function Twiliobot(configuration) {
var channels = bot.channels;

// if its not in a channel with the bot
var apprChan = channels.filter(function (ch) {
var apprChan = channels.filter(function(ch) {
return ch.sid == message.channel;
});

Expand All @@ -266,17 +266,17 @@ function Twiliobot(configuration) {
} else if (message.EventType === 'onMemberAdded') {

if (bot.identity && message.user === bot.identity) {
bot.api.channels(message.channel).fetch().then(function (response) {
bot.api.channels(message.channel).fetch().then(function(response) {
bot.channels.push(response);
twilio_botkit.debug('Subscribing to channel because of memberadd.');
}).catch(function (error) {
}).catch(function(error) {
botkit.log(error);
});
} else if (bot.identity) {
var channels = bot.channels;

// if its not in a channel with the bot
var apprChan = channels.filter(function (ch) {
var apprChan = channels.filter(function(ch) {
return ch.sid == message.channel;
});

Expand All @@ -292,26 +292,26 @@ function Twiliobot(configuration) {
}
} else if (message.EventType === 'onChannelDestroyed') {
if (bot.identity) {
var chan_to_rem = bot.channels.map(function (ch) {
var chan_to_rem = bot.channels.map(function(ch) {
return ch.sid;
}).indexOf(message.channel);
if (chan_to_rem !== -1) {
bot.channels.splice(chan_to_rem, 1);
twilio_botkit.debug('Unsubscribing from destroyed channel.');
}
message.type = 'channel_destroyed'
message.type = 'channel_destroyed';
}
} else if (message.EventType === 'onChannelAdded') {
if (bot.identity && bot.config.autojoin === true) {
// join the channel
bot.api.channels(message.channel).members.create({
identity: bot.identity
}).then(function (response) {
return bot.api.channels(message.channel).fetch().then(function (response) {
}).then(function(response) {
return bot.api.channels(message.channel).fetch().then(function(response) {
bot.channels.push(response);
twilio_botkit.debug('Subscribing to new channel.');
})
}).catch(function (error) {
});
}).catch(function(error) {
botkit.log(error);
});
message.type = message.EventType;
Expand Down

0 comments on commit 254cb3d

Please sign in to comment.