X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=turbot_lambda%2Fturbot_lambda.py;h=1aa428fa95c0740d05c8aa3368877479a07f66ea;hb=5f24de7e9cdb24f5bf751e3ce1d6d7333241747f;hp=7d8ac4d917cbd46dd148296397ce51ac18e7e1e0;hpb=3f55f48bd1a209854aef278b7e70e663cda4ee9a;p=turbot diff --git a/turbot_lambda/turbot_lambda.py b/turbot_lambda/turbot_lambda.py index 7d8ac4d..1aa428f 100644 --- a/turbot_lambda/turbot_lambda.py +++ b/turbot_lambda/turbot_lambda.py @@ -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