Slack bot that helps users to do polling and allows users.
/poll "Question" "Option 1" "Option 2" -- encapsulate each individual option in double quotes
To integrate into your Slack workspace, you will need to create a Slack App and configure
- Interactive Components > Interactivity > Request URL (for the /hook Endpoint)
- Slash Commands (for the /poll Endpoint)
- OAuth & Permissions > Scopes > Add permissions [
chat:write:bot
,commands
,reactions:write
]
Initialize .env
file with (Check k8s secret in iCloud slack-poll folder)
DATABASE_URL
(if SQLite ignoreDATABASE_URL
)SLACK_VERIFICATION_TOKEN
,SLACK_ACCESS_TOKEN
from your SlackApp- (Optional) You can define the poll display name in slack via
SLACK_MESSAGE_BAR_COLOR
(default: #ffd100) - (Optional) You can define the poll side color from the message via
SLACK_APP_DISPLAY_NAME
(default: Yellow Poll) - (Optional) You can use
icon_emoji
list as a comma separed list withSLACK_MESSAGE_ICON_EMOJIS
env var to change the slack bot profile image, if you define more than one it will pick one randomly. iex:one,two,three
. (default: 📊)
cp .env.example .env
npm start
Generating Migrations
./node_modules/.bin/sequelize migration:generate --name <migration_name>
Running daemon
npm run dev
# Build docker
docker build -t danghung/slack-poll .
docker push danghung/slack-poll
# Deploy
kubectl apply -f deploy-dev.yml
OR
k rollout restart deployment/slack-poll