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:botchat:write:userbotcommandsusers.profile:read
-
The following
slashcommands:/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
interactivecomponents (should be toggled toon):registerVoteaction URL: This is going to show up in thegcloud functions deployoutput for theregisterVotefunction. You only have to do this when you first deploy theregisterVotefunction but you'll have to enter theURLof theregisterVotegcloud function in Request URL.
-
A
bot userwith 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
slacktokenand slacksigningsecretusingberglasand 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"

