Skip to content

Commit

Permalink
Add error for /leader-add outside a club channel
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwofford committed Jan 18, 2020
1 parent febc84b commit bf9e6b3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/interactions/leaderAdd.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ const interactionLeaderAdd = async (bot, message) => {
throw transcript('leaderAdd.invalidClub')
}

if (!recipientClub) {
throw transcript('leaderAdd.clubNotFound')
}

if (commandUser.club && commandUser.club.id != recipientClub.id) {
// A leader is trying to permission someone to a channel that's not their
// club channel
Expand Down
1 change: 1 addition & 0 deletions src/utils/transcript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ leaderAdd:
Additionally, you can see a list of who is already a leader with \`/leader-list\`
invalidAuth: I couldn't find your club. Only registered leaders or operations team members can run this command.
invalidChannel: This isn't your club channel. Please run this in a channel you lead.
clubNotFound: This channel isn't tied to a club! Please run this in a club channel.
alreadyLeader: They're already a leader in your club!
success: And... done! I've added <@${this.taggedUserID}> to the club in <#${this.channel}>.
leaderList:
Expand Down

0 comments on commit bf9e6b3

Please sign in to comment.