Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 3 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 (about 4 years ago)
- Default Branch: master
- Last Pushed: 2023-07-25T17:36:32.000Z (over 1 year ago)
- Last Synced: 2024-10-11T18:41:51.869Z (3 months ago)
- Topics: fastapi, slack, slackbot, slash-commands
- Language: Python
- Homepage:
- Size: 109 KB
- Stars: 10
- Watchers: 5
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fastapi-slack
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-brightgreen.svg)](https://conventionalcommits.org)
[![CircleCI](https://circleci.com/gh/dialoguemd/fastapi-slack.svg?style=svg&circle-token=d5088d3188d29980a98d21136927b0693ea7d90e)](https://circleci.com/gh/dialoguemd/fastapi-slack)
[![codecov](https://codecov.io/gh/dialoguemd/fastapi-slack/branch/master/graph/badge.svg?token=CVU9WOYOEG)](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 FastAPIapp = 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, routerapp = 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