From: Carl Worth <cworth@cworth.org>
Date: Sat, 17 Oct 2020 01:06:31 +0000 (-0700)
Subject: Invite user to new hunt channel when they create a hunt
X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=6ea1a40d0fdf0182e2b3154ffc7d4bc91e2a9541;p=turbot

Invite user to new hunt channel when they create a hunt

Kind of silly to leave out the initiating user, you see.
---

diff --git a/turbot/actions.py b/turbot/actions.py
index ca4aa02..30ae676 100644
--- a/turbot/actions.py
+++ b/turbot/actions.py
@@ -46,6 +46,7 @@ def new_hunt_submission(turb, payload):
             'statusCode': 400
         }
 
+    user_id = payload['user']['id']
     channel_id = response['channel']['id']
 
     turb.hunts_table = turb.db.Table("hunts")
@@ -59,6 +60,8 @@ def new_hunt_submission(turb, payload):
         }
     )
 
+    turb.slack_client.conversations_invite(channel=channel_id, users=user_id)
+
     return {
         'statusCode': 200,
     }