diff --git a/src/interactions/leaderAdd.js b/src/interactions/leaderAdd.js index 6d7abba0..016d2597 100644 --- a/src/interactions/leaderAdd.js +++ b/src/interactions/leaderAdd.js @@ -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, diff --git a/src/text.yml b/src/text.yml index b1938db9..42e210d1 100644 --- a/src/text.yml +++ b/src/text.yml @@ -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.