Skip to content

Commit

Permalink
labhub: Adapt to the modified newcomer process
Browse files Browse the repository at this point in the history
- `invite me` variation of invite command is removed.
- "Hello world"s no longer trigger invites.
- Newcomer invitation message is changed to show the modification in the
  newcomer process.

Closes #476
  • Loading branch information
meetmangukiya committed Dec 10, 2017
1 parent f3ba1ec commit 4d4caaa
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions plugins/labhub.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ class LabHub(BotPlugin):
"""GitHub and GitLab utilities""" # Ignore QuotesBear

INVITE_SUCCESS = {
'newcomers': 'Welcome @{}! :tada:\n\nWe\'ve just sent you an invite'
' via email. Please accept it before proceeding forward.'
'\nTo get started, please follow our [newcomers guide]'
'(https://coala.io/newcomer). Most '
'newcomers': 'Welcome @{}! :tada:\n\n'
'Please go through https://coala.io/newcomer (skip '
'instructions about using corobo). Find your first issue '
'and ask one of the maintainers to assign you to it and '
'we\'ll invite you to the org. Most '
'issues will be explained there and in linked pages - it '
'will save you a lot of time, just read it. *Really.*\n\n'
'*Do not take an issue if you don\'t understand it on '
Expand Down Expand Up @@ -106,13 +107,6 @@ def invite_cmd(self, msg, match):
invitee = match.group(1)
inviter = msg.frm.nick

if invitee == 'me':
user = msg.frm.nick
self.send(msg.frm, self.INVITE_SUCCESS['newcomers'].format(user))
self.TEAMS[self.GH_ORG_NAME + ' newcomers'].invite(user)
self.invited_users.add(user)
return

team = 'newcomers' if match.group(2) is None else match.group(2)

self.log.info('{} invited {} to {}'.format(inviter, invitee, team))
Expand Down Expand Up @@ -143,8 +137,6 @@ def callback_message(self, msg):
# send the invite
self.send(msg.frm,
self.INVITE_SUCCESS['newcomers'].format(user))
self.TEAMS[self.GH_ORG_NAME + ' newcomers'].invite(user)
self.invited_users.add(user)

@re_botcmd(pattern=r'(?:new|file) issue ([\w\-\.]+?)(?: |\n)(.+?)(?:$|\n((?:.|\n)*))', # Ignore LineLengthBear, PyCodeStyleBear
re_cmd_name_help='new issue repo-name title\n[description]',
Expand Down

0 comments on commit 4d4caaa

Please sign in to comment.