From: Carl Worth Date: Wed, 21 Oct 2020 16:39:54 +0000 (-0700) Subject: Add a stub function for hanlding a shortcut invocation X-Git-Url: https://git.cworth.org/git?p=turbot;a=commitdiff_plain;h=362d78c779bbb7762b68ffb80647bbd08c96edfc Add a stub function for hanlding a shortcut invocation We're not currently pursuing this option, (because the global shortcuts are annoyingly truly global---they would be a lot more useful it the payload included the ID of the current channel from where they were invoked). But here's the stub in case we ever want to start using these in the future. --- diff --git a/turbot_lambda/turbot_lambda.py b/turbot_lambda/turbot_lambda.py index 46db3ce..2ba9184 100644 --- a/turbot_lambda/turbot_lambda.py +++ b/turbot_lambda/turbot_lambda.py @@ -167,6 +167,8 @@ def turbot_interactive(turb, payload): return turbot_block_action(turb, payload) if type == 'view_submission': return turbot.actions.view_submission(turb, payload) + if type == 'shortcut': + return turbot_shortcut(turb, payload); return error("Unrecognized interactive type: {}".format(type)) def turbot_block_action(turb, payload): @@ -192,6 +194,15 @@ def turbot_block_action(turb, payload): return turbot.actions.actions[atype][avalue](turb, payload) return error("Unknown action of type/value: {}/{}".format(atype, avalue)) +def turbot_shortcut(turb, payload): + """Handler for Slack shortcuts + + These are invoked as either global or message shortcuts by a user.""" + + print("In turbot_shortcut, payload is: {}".format(str(payload))) + + return error("Shortcut interactions not yet implemented") + def turbot_slash_command(turb, body): """Implementation for Slack slash commands.