Slack extension for FastAPI.
Project description
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:
import fastapi_slack
from fastapi import FastAPI
app = FastAPI()
app.include_router(fastapi_slack.router)
Slash Commands
- Dependency
fastapi_slack.with_slash_command
validates request signature and extract the slash command info needed to process it:
from fastapi import Depends, FastAPI
from fastapi_slack import SlashCommand, router, with_slash_command
app = FastAPI()
app.include_router(router)
@app.post("/slash-commands")
def process_commands(slash_command: SlashCommand = Depends(with_slash_command)):
pass
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fastapi-slack-0.2.0.tar.gz
(4.0 kB
view hashes)
Built Distribution
Close
Hashes for fastapi_slack-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 542a23faeecf7a579e8f18ef5bd8d8ad0b6701933ad39b85f87f4e511c7c19cb |
|
MD5 | 3d8e0e9ef607652d2fbd66c4d68fc73e |
|
BLAKE2b-256 | d998d13066867addfc76da61c05b1d3c80bc1c37d65506f3c2d1a418c8359af6 |