]> git.cworth.org Git - turbot/commitdiff
Fix error with missing search terems
authorCarl Worth <cworth@cworth.org>
Tue, 5 Jan 2021 18:49:23 +0000 (10:49 -0800)
committerCarl Worth <cworth@cworth.org>
Tue, 5 Jan 2021 18:49:23 +0000 (10:49 -0800)
Some recent change made a command like "/hunt solved" result in an error.
This commit fixes that.

turbot/interaction.py

index 0f71b01fc1159cd5f18f184bf83b174266db7b21..e6f7503e20bf2ffd5a1e53ae924230ab370a4931 100644 (file)
@@ -635,6 +635,7 @@ def hunt(turb, body, args):
     channel_id = body['channel_id'][0]
     response_url = body['response_url'][0]
 
+    terms = None
     if args:
         # The first word can be a puzzle status and all remaining word
         # (if any) are search terms. _But_, if the first word is not a
@@ -649,7 +650,6 @@ def hunt(turb, body, args):
             status = 'unsolved'
     else:
         status = 'unsolved'
-        terms = None
 
     # Separate search terms on spaces (but allow for quotation marks
     # to capture spaces in a search term)