Do you want to get simple attendance checks? If you are using Slack, participants can just react on a specific post, then we can check the attendance based on the reaction. It's so simple and fun.
If you are not familiar with the libraries below, please read the documentation for the links below before getting started.
users.profile:read
) and install to work space.git clone https://github.com/UpstageAI/slack-event-subscriptions.git
cd slack-event-subscriptions
pip install -r requirements.txt
zappa init
Update the zappa_settings.json
like the example below.
aws_region
, REGION_NAME
: AWS region for your servicesSLACK_SIGNING_SECRET
: Siging secret of your slack appSLACK_OAUTH_TOKEN
: Oauth token of your slack appTABLE_NAME
: Table name for DynamoDBSLACK_CHECK_CHANNEL
: Specific channel id for the event subscription. (if it's empty, you will get the events from all channels.)KEY_WORD
: In case you want to filter some users based on their name.
###Example for `zappa_settings.json`
{
"dev": {
"app_function": "app.app",
"aws_region": "ap-northeast-2",
"profile_name": null,
"project_name": "slack-event-sub",
"runtime": "python3.8",
"s3_bucket": "zappa-ih029w3pa",
"environment_variables": {
"SLACK_SIGNING_SECRET": "
zappa deploy dev
...
Waiting for stack slack-event-sub2-dev to create (this can take a bit)..
50%|███████████████████████████████████████████████ | 2/4 [00:09<00:09, 4.90s/res]
Deploying API Gateway..
Deployment complete!: https://eycl36fqk9.execute-api.ap-northeast-2.amazonaws.com/dev
zappa invoke dev 'from db import create_table;create_table()' --raw
<YOUR_ENDPOINT_URL>/slack/events
reaction_added
and user_change
Once you finish the setting, post the sample message in your slack channel and add a reaction.
Then, you can find two tables from your DynamoDB.
the shorter name one is the table for the event storing
And, the table with a suffix
_user
is an actual organized version by the date and the name of the users.
You can also access the data via api
<YOUR_ENDPOINT>/csv
, and it will return csv
version.
user_id,username,z20210112
U01JH17VD19,Jungwon Seo,17:35:19
U01JH17VD20,Junglost Seo,17:36:20
U01JH17VD33,Jungdraw Seo,17:37:33
...
The csv api supports two query parameters d
and s
.
d
: specific date for the list (e.g., d=20210112), if none, entire dataset will be returned.
s
: sorting key for the result (e.g., s='user_id`). Only ascending order supports yet.
You can update the temporary environment variable in pytest.ini
pytest test.py
zappa update dev
zappa invoke dev 'from db import delete_table;delete_table()' --raw
zappa undeploy dev
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
git checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)Distributed under the MIT License. See LICENSE
for more information.
Jungwon Seo - wsbtgt@gmail.com
Project Link: https://github.com/UpstageAI/slack-event-subscriptions