Mail Tale is the Slack bot to manage subscriptions for my Hack Club community newsletter!
- Go to the Slack API and create a new app
- Use the following manifest:
{
"display_information": {
"name": "Mail Tale",
"description": "The tale of your mail is so beautiful",
"background_color": "#702eb3"
},
"features": {
"bot_user": {
"display_name": "Mail Tale",
"always_online": false
},
"slash_commands": [
{
"command": "/subscribe",
"url": "URL",
"description": "Subscribe to the #community-newsletter",
"should_escape": false
},
{
"command": "/subscription",
"url": "URL",
"description": "Manage your #community-newsletter subscription",
"should_escape": false
}
]
},
"oauth_config": {
"scopes": {
"bot": [
"commands",
"chat:write"
]
}
},
"settings": {
"event_subscriptions": {
"request_url": "URL",
"bot_events": [
"app_home_opened"
]
},
"interactivity": {
"is_enabled": true,
"request_url": "URL"
},
"org_deploy_enabled": false,
"socket_mode_enabled": false,
"token_rotation_enabled": false
}
}
- Install the app to your workspace
- Copy the bot token and signing secret
- Clone the repository
- Create a venv with
python3.12 -m venv .venv
- Activate the venv with
source .venv/bin/activate
- Install dependencies with
python3.12 -m pip install -r requirements.txt
- Create a
.env
file with the following variables:SLACK_BOT_TOKEN
: The Slack bot tokenSLACK_SIGNING_SECRET
: The Slack signing secretPUB_CHANNEL_ID
: The public channel to log toAIRTABLE_TOKEN
: The Airtable API tokenAIRTABLE_BASE_ID
: The Airtable base ID
- Run the bot with
python3.12 app.py