]> git.cworth.org Git - turbot/commitdiff
Gracefully handle placeholder text for hunt channel ID
authorCarl Worth <cworth@cworth.org>
Sat, 17 Oct 2020 00:28:01 +0000 (17:28 -0700)
committerCarl Worth <cworth@cworth.org>
Sat, 17 Oct 2020 00:29:57 +0000 (17:29 -0700)
Letting the user know that a Slack channel is still being created
if the channel ID is a placeholder value.

turbot/events.py

index dfe4cb96bf7542c4518aab53af3d9ef00a1af694..78fc560e8c238e72fe70f6bceb3e0efae2d0286a 100644 (file)
@@ -1,7 +1,16 @@
 from turbot.blocks import section_block, text_block, button_block, actions_block
 
 def hunt_block(hunt):
-    text = "{}: <#{}>".format(hunt['name'], hunt['channel_id'])
+    name = hunt['name']
+    channel_id = hunt['channel_id']
+
+    text = "{}: ".format(name)
+
+    if (channel_id.startswith("placeholder-")):
+        text += "[Slack channel is still being created. Please wait.]"
+    else:
+        text += "<#{}>".format(channel_id)
+
     return section_block(text_block(text))
 
 def home(turb, user_id, body):