From a6a0028a87085c7531c113b9e9f98b25f97e56c9 Mon Sep 17 00:00:00 2001 From: Max Wofford Date: Tue, 24 Sep 2019 13:41:08 -0400 Subject: [PATCH] Attempt to fix slash commands in private channels --- src/interactions/leaderList.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/interactions/leaderList.js b/src/interactions/leaderList.js index 2ff83fa1..2fe4c854 100644 --- a/src/interactions/leaderList.js +++ b/src/interactions/leaderList.js @@ -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 } @@ -31,7 +34,7 @@ const interactionLeaderList = (bot, message) => { ) .then(leaders => { console.log(leaders) - bot.whisper( + bot.replyPrivateDelayed( message, transcript('leaderList.list', { leaders, channel }) ) @@ -41,7 +44,7 @@ const interactionLeaderList = (bot, message) => { }) }) .catch(err => { - bot.whisper(err) + bot.replyPrivateDelayed(err) console.error(err) }) }