hunt_text += " matching {}".format(" AND ".join(quoted_terms))
blocks = [
- accessory_block(
- section_block(text_block(hunt_text)),
- button_block("✏", "edit_hunt", hunt_id)
- )
+ [
+ accessory_block(
+ section_block(text_block(hunt_text)),
+ button_block("✏", "edit_hunt", hunt_id)
+ )
+ ]
]
block = blocks[0]
block.append(divider_block())
return blocks
+
+def hunt_update_topic(turb, hunt):
+
+ channel_id = hunt['channel_id']
+
+ topic = ''
+
+ url = hunt.get('url', None)
+ if url:
+ topic += "<{}|Hunt website> ".format(url)
+
+ topic += "<https://halibut.cworth.org/{}|Big Board> ".format(
+ hunt['channel_id'])
+
+ state = hunt.get('state', None)
+ if state:
+ topic += state
+
+ # Slack only allows 250 characters for a topic
+ if len(topic) > 250:
+ topic = topic[:247] + "..."
+ turb.slack_client.conversations_setTopic(channel=channel_id,
+ topic=topic)