From e2585ffb4c53bb9c842cbcc3dba77a705c069371 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Sat, 16 Jan 2021 08:03:10 -0800 Subject: [PATCH] Restrict list of blocks to 100 items Since I've now seen Slack complaining if lists are greater than 100 items. --- turbot/interaction.py | 4 ++++ 1 file changed, 4 insertions(+) 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'} -- 2.43.0