From: Carl Worth Date: Sat, 17 Oct 2020 00:28:01 +0000 (-0700) Subject: Gracefully handle placeholder text for hunt channel ID X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=d29699ecca69f7d203179a18569722d05798cf58;p=turbot Gracefully handle placeholder text for hunt channel ID Letting the user know that a Slack channel is still being created if the channel ID is a placeholder value. --- diff --git a/turbot/events.py b/turbot/events.py index dfe4cb9..78fc560 100644 --- a/turbot/events.py +++ b/turbot/events.py @@ -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):