]> git.cworth.org Git - turbot/commitdiff
Invite user to new hunt channel when they create a hunt
authorCarl Worth <cworth@cworth.org>
Sat, 17 Oct 2020 01:06:31 +0000 (18:06 -0700)
committerCarl Worth <cworth@cworth.org>
Sat, 17 Oct 2020 01:08:32 +0000 (18:08 -0700)
Kind of silly to leave out the initiating user, you see.

turbot/actions.py

index ca4aa02d48a0899afeab1bedd04ad1651b608739..30ae6767d774a5a6268b8a795f1a714e2ce7aea2 100644 (file)
@@ -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,
     }