Skip to content

Commit

Permalink
Add help message for leader-add
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwofford committed Sep 18, 2019
1 parent 6a1c9f9 commit 8af6281
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/interactions/leaderAdd.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ const interactionLeaderAdd = (bot, message) => {
getInfoForUser(taggedUserID)
.then(taggedUser => {
console.log('found tagged user')
// if user doesn't exist
if (taggedUser.slackUser.is_bot) {
throw new Error('bots cannot be leaders')
}
if (!taggedUser.leader) {
// if user doesn't exist
const profile = taggedUser.slackUser.profile
const fields = {
Email: taggedUser.slackUser.profile.email,
Expand Down
4 changes: 4 additions & 0 deletions src/text.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ meetingTime:
success: Ok, I'll post a message in your club's channel around ${this.hour}:00 on ${this.day} UTC
parsingError: I couldn't figure out what day and time you meant
leaderAdd:
help: >
Registers a new leader to your club. Ex. \`/leader-add @orpheus\`
_Needs to be run by a club leader in their own club channel_
Additionally, you can see a list of who is already a leader with \`/leader-list\`
invalidUser: Only club leaders can use this command.
invalidClub: I couldn't find your club.
invalidChannel: This isn't your club channel. Please run this in a channel you lead.
Expand Down

0 comments on commit 8af6281

Please sign in to comment.