Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Edwards, Chris authored and Edwards, Chris committed Aug 14, 2017
2 parents 5f434fe + 245b5a1 commit a579cab
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ function handler(event, context, callback) {
response_url
} = parseFormString(body);

console.log('PROCESSING SLACK COMMAND', text, response_url, SPOTIFY_RADIO_PLAYLIST)

if (token !== SLACK_TOKEN) {
callback(null,
slack.slackResp(
Expand All @@ -41,6 +43,7 @@ function handler(event, context, callback) {
SPOTIFY_USER_ACCESS_TOKEN
)
.catch((error) => {
console.log(error);
callback(null,
slack.slackResp(error.message)
);
Expand All @@ -57,11 +60,11 @@ function handler(event, context, callback) {
SPOTIFY_LOCAL_URL
)
.then((msg) => {
console.log('notify', response_url, msg);

console.log('notify success', response_url, msg);
slack.notify(response_url, msg);
})
.catch(({ message }) => {
console.log('notify error', response_url, message);
slack.notify(response_url, `Error creating playlist: ${message}`)
});
});
Expand Down

0 comments on commit a579cab

Please sign in to comment.