X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;ds=sidebyside;f=turbot%2Finteraction.py;fp=turbot%2Finteraction.py;h=25307c22a26aec26084da1b623ebaee2acec069f;hb=1af32409a8d60e9580a0873bd8b2fa3c676c37ee;hp=21e741e8c19ac84776e8c36330c295876315d553;hpb=eb254b77f03f7e5ef51bc67033531f4690f50751;p=turbot diff --git a/turbot/interaction.py b/turbot/interaction.py index 21e741e..25307c2 100644 --- a/turbot/interaction.py +++ b/turbot/interaction.py @@ -5,7 +5,8 @@ from turbot.blocks import ( from turbot.hunt import ( find_hunt_for_hunt_id, hunt_blocks, - hunt_puzzles_for_hunt_id + hunt_puzzles_for_hunt_id, + hunt_update_topic ) from turbot.puzzle import ( find_puzzle_for_url, @@ -459,6 +460,10 @@ def edit_hunt(turb, hunt, trigger_id): input_block("Hunt URL", "url", "External URL of hunt", initial_value=hunt.get("url", None), optional=True), + input_block("State", "state", + "State of the hunt (goals, upcoming meetings, etc.)", + initial_value=hunt.get("state", None), + optional=True), checkbox_block("Is this hunt active?", "Active", "active", checked=(hunt.get('active', False))) ] @@ -497,6 +502,9 @@ def edit_hunt_submission(turb, payload, metadata): if url: hunt['url'] = url + hunt_state = state['state']['state']['value'] + if hunt_state: + hunt['state'] = hunt_state if state['active']['active']['selected_options']: hunt['active'] = True else: @@ -522,6 +530,9 @@ def edit_hunt_submission(turb, payload, metadata): turb.slack_client, hunt['channel_id'], edit_message, blocks=blocks) + # Update channel topic and description + hunt_update_topic(turb, hunt) + return lambda_ok def new_hunt_command(turb, body):