Skip to content

Commit

Permalink
Attempt to fix slash commands in private channels
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwofford committed Sep 24, 2019
1 parent 4570ed9 commit a6a0028
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/interactions/leaderList.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,22 @@ const interactionLeaderList = (bot, message) => {
console.log(
`${user} isn't a leader, so I told them this was restricted`
)
bot.whisper(message, transcript('leaderList.invalidUser'))
bot.replyPrivateDelayed(message, transcript('leaderList.invalidUser'))
return
}

if (!club) {
console.log(`${user} doesn't have a club`)
bot.whisper(message, transcript('leaderList.invalidClub'))
bot.replyPrivateDelayed(message, transcript('leaderList.invalidClub'))
return
}

if (club.fields['Slack Channel ID'] != channel) {
console.log(`${user} doesn't own channel ${channel}`)
bot.whisper(message, transcript('leaderList.invalidChannel'))
bot.replyPrivateDelayed(
message,
transcript('leaderList.invalidChannel')
)
return
}

Expand All @@ -31,7 +34,7 @@ const interactionLeaderList = (bot, message) => {
)
.then(leaders => {
console.log(leaders)
bot.whisper(
bot.replyPrivateDelayed(
message,
transcript('leaderList.list', { leaders, channel })
)
Expand All @@ -41,7 +44,7 @@ const interactionLeaderList = (bot, message) => {
})
})
.catch(err => {
bot.whisper(err)
bot.replyPrivateDelayed(err)
console.error(err)
})
}
Expand Down

0 comments on commit a6a0028

Please sign in to comment.