https://github.com/chdsbd/timeoff
🤖 A Slack bot to create time off requests at AdmitHub
https://github.com/chdsbd/timeoff
flask lambda pdf-generation slack-bot
Last synced: 2 months ago
JSON representation
🤖 A Slack bot to create time off requests at AdmitHub
- Host: GitHub
- URL: https://github.com/chdsbd/timeoff
- Owner: chdsbd
- Created: 2019-07-14T16:19:49.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-09-02T03:58:08.000Z (almost 7 years ago)
- Last Synced: 2025-10-30T06:36:01.332Z (8 months ago)
- Topics: flask, lambda, pdf-generation, slack-bot
- Language: Python
- Homepage:
- Size: 162 KB
- Stars: 1
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# time off
This bot isn't really useful for anyone besides employees at AdmitHub.
This bot is triggered by a slash command `/timeoff`, which opens a Slack dialog
to get data to fill into the PDF form. Some Python code fills in a PDF and
uploads it to the channel.
## dev
```bash
# install dependencies
poetry install
# copy environment file
cp .env-example .env
# create an app and copy the token in the .env file
open 'https://api.slack.com/apps?new_app=1'
# generate a pdf
poetry run python -m timeoff.pdf_generation \
--input-path form.pdf \
--employee-name 'Christopher Dignam' \
--employee-signature '~~Chris' \
--employee-requested-dates '2019-08-16 to 2019-08-20'
# start the slack bot web server
poetry run python -m timeoff.web
```
## deployment
Deployment uses zappa which is a wrapper around AWS Lambda. See the [Zappa
documentation](https://github.com/Miserlou/Zappa) for info on setting up an
environment.
When you first deploy you'll get a health check error because we need to
configure the environment variables for the lambda function to include the app
token.
```bash
# setup an environment for the first time
poetry run zappa deploy dev
# redeploy an environment
poetry run zappa update dev
# view logs
poetry run zappa tail dev
```