https://github.com/dialoguemd-archives/fastapi-slack
Slack extension for FastAPI.
https://github.com/dialoguemd-archives/fastapi-slack
fastapi slack slackbot slash-commands
Last synced: 9 months ago
JSON representation
Slack extension for FastAPI.
- Host: GitHub
- URL: https://github.com/dialoguemd-archives/fastapi-slack
- Owner: dialoguemd-archives
- License: mit
- Created: 2020-12-24T20:46:44.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-07-25T17:36:32.000Z (almost 3 years ago)
- Last Synced: 2025-05-11T16:41:39.786Z (about 1 year ago)
- Topics: fastapi, slack, slackbot, slash-commands
- Language: Python
- Homepage:
- Size: 109 KB
- Stars: 10
- Watchers: 4
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fastapi-slack
[](https://conventionalcommits.org)
[](https://circleci.com/gh/dialoguemd/fastapi-slack)
[](https://codecov.io/gh/dialoguemd/fastapi-slack)
Slack extension for FastAPI.
## Configuration - Environment Variables
### `slack_access_token`
Bot User OAuth Access Token as defined in OAuth & Permissions menu of the slack app.
### `slack_signing_secret`
App signing secret as shown in Basic Information menu of the slack app in the App
Credentials section.
## Setup
* Include fastapi-slack router:
```python
import fastapi_slack
from fastapi import FastAPI
app = FastAPI()
app.include_router(fastapi_slack.router)
```
## [Slash Commands]
Depending on `fastapi_slack.SlashCommand` validates Slack request signature and extracts
the info needed to process it:
```python
from fastapi import Depends, FastAPI
from fastapi_slack import SlashCommand, router
app = FastAPI()
app.include_router(router)
@app.post("/slash-commands")
def process_command(slash_command: SlashCommand = Depends()):
pass
```
[Slash Commands]: https://api.slack.com/interactivity/slash-commands