]> git.cworth.org Git - turbot/blobdiff - turbot_lambda/turbot_lambda.py
Make /edit command smart to auto-edit either puzzle or hunt
[turbot] / turbot_lambda / turbot_lambda.py
index 7d8ac4d917cbd46dd148296397ce51ac18e7e1e0..1aa428fa95c0740d05c8aa3368877479a07f66ea 100644 (file)
@@ -59,6 +59,7 @@ service = build('drive',
                 'v3',
                 credentials=gsheets_creds,
                 cache_discovery=False)
+files = service.files()
 permissions = service.permissions()
 
 db = boto3.resource('dynamodb')
@@ -66,7 +67,9 @@ db = boto3.resource('dynamodb')
 turb = SimpleNamespace()
 turb.slack_client = slack_client
 turb.db = db
+turb.table = db.Table("turbot")
 turb.sheets = sheets
+turb.files = files
 turb.permissions = permissions
 
 def error(message):
@@ -153,7 +156,7 @@ def turbot_interactive_or_slash_command(turb, event, context):
     """Handler for Slack interactive things (buttons, shortcuts, etc.)
     as well as slash commands.
 
-    This function simply makes a quiuck determination of what we're looking
+    This function simply makes a quick determination of what we're looking
     at and then defers to either turbot_interactive or turbot_slash_command."""
 
     # Both interactives and slash commands have a urlencoded body
@@ -198,7 +201,10 @@ def turbot_block_action(turb, payload):
     action = actions[0]
 
     atype = action['type']
-    avalue = action['value']
+    if 'value' in action:
+        avalue = action['value']
+    else:
+        avalue = '*'
 
     if (
             atype in turbot.interaction.actions