From: Carl Worth Date: Sat, 16 Jan 2021 16:03:10 +0000 (-0800) Subject: Restrict list of blocks to 100 items X-Git-Url: https://git.cworth.org/git?p=turbot;a=commitdiff_plain;h=e2585ffb4c53bb9c842cbcc3dba77a705c069371 Restrict list of blocks to 100 items Since I've now seen Slack complaining if lists are greater than 100 items. --- diff --git a/turbot/interaction.py b/turbot/interaction.py index 94787b4..580aad5 100644 --- a/turbot/interaction.py +++ b/turbot/interaction.py @@ -1270,6 +1270,8 @@ def hunt(turb, body, args): blocks = hunt_blocks(turb, hunt, puzzle_status=status, search_terms=terms) for block in blocks: + if len(block) > 100: + block = block[:100] requests.post(response_url, json = { 'blocks': block }, headers = {'Content-type': 'application/json'} @@ -1345,6 +1347,8 @@ def round(turb, body, args): ) for block in blocks: + if len(block) > 100: + block = block[:100] requests.post(response_url, json = { 'blocks': block }, headers = {'Content-type': 'application/json'}