]> git.cworth.org Git - turbot/commit
turbot_lambda: Inject /rot response into the same channel as the command
authorCarl Worth <cworth@cworth.org>
Mon, 12 Oct 2020 21:13:24 +0000 (14:13 -0700)
committerCarl Worth <cworth@cworth.org>
Mon, 12 Oct 2020 21:45:05 +0000 (14:45 -0700)
commit251ec9ee2460cab2a15af4d4e7dfbceb7cd22b10
tree2497350b415c7973e6c0078be80b081443898669
parenta377e260992b6ab2949d5dfe4b835caae4980e4f
turbot_lambda: Inject /rot response into the same channel as the command

Prior to this commit, we were just including the rot result in the
response to the POST request. That was sufficient for Slack to take
the result and present it privately to the user that issued the
command. But that would not allow any other user in the same channel
to see the same result.

Here, instead, we use the Slack WebClient API to inject the result
into the user's channel as a new message. This takes advantage of a
new, encrypted SSM parameter SLACK_BOT_TOKEN to authenticate our
bot. It also requires bundling all of the virtualenv dependencies into
the zip file uploaded to AWS for the lambda, so that's what the
Makefile modifications do here.
Makefile
turbot_lambda/turbot_lambda.py