]> git.cworth.org Git - turbot/blobdiff - turbot/interaction.py
Restrict list of blocks to 100 items
[turbot] / turbot / interaction.py
index 94787b40fbc28e15c7773f0ca497b5dcf4bea1b9..580aad52b15e2b03e002fb835917c615d86c2ec8 100644 (file)
@@ -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'}