Marco Poller is a slack app that does one thing: manage slack polls. Yes, there are many slack polling applications at the moment. Chances are that you don't need this. But if you're part of an organisation that doesn't allow 3rd party slack apps or if you just feel like having your own version that does its thing a little differently, go ahead and look at Marco Poller.
-
A bot slack token
-
With the following
scopes
:chat:write:bot
chat:write:user
bot
commands
users.profile:read
-
The following
slash
commands:/poll
:- Command:
/poll
- Request URL:
<url of the startPoll gcloud function>
- Short Description:
Starts a new poll
- Usage Hint:
"Question?" "Option1" "Option 2"
- Command:
-
The following
interactive
components (should be toggled toon
):registerVote
action URL: This is going to show up in thegcloud functions deploy
output for theregisterVote
function. You only have to do this when you first deploy theregisterVote
function but you'll have to enter theURL
of theregisterVote
gcloud function in Request URL.
-
A
bot user
with the recommended info:- Display name:
Marco Poller
- Display username:
marcopoller
- Display name:
-
-
A gcloud project ID with the datastore API enabled
-
A way to store secrets (needed for the slack token and the slack signing secret)
The ready-to-deploy vanilla version of Marco Poller
uses berglas to manage secrets and lives at github.com/alexandre-normand/marcopoller-vanilla.
Refer to the berglas gcloud functions example and documentation on how to set
up berglas with gcloud functions.
-
Make sure you've written the
slacktoken
and slacksigningsecret
usingberglas
and that you've granted the service account access to those. If you haven't done so already, refer to the berglas gcloud functions example and documentation for how to do this. -
Deploy the vanilla/berglas version using the gcloud cli commands from github.com/alexandre-normand/marcopoller/berglas:
gcloud functions deploy startPoll --entry-point StartPoll --runtime go111 --trigger-http --project $PROJECT_ID --service-account ${SA_EMAIL} --set-env-vars "PROJECT_ID=${PROJECT_ID},SLACK_TOKEN=berglas://${BUCKET_ID}/slacktoken,SIGNING_SECRET=berglas://${BUCKET_ID}/signingsecret"
gcloud functions deploy registerVote --entry-point RegisterVote --runtime go111 --trigger-http --project $PROJECT_ID --service-account ${SA_EMAIL} --set-env-vars "PROJECT_ID=${PROJECT_ID},SLACK_TOKEN=berglas://${BUCKET_ID}/slacktoken,SIGNING_SECRET=berglas://${BUCKET_ID}/signingsecret"