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
- Dependding on
fastapi_slack.SlashCommand
automatically validates Slack request signature and extract the info needed to process it:
from fastapi import Depends, FastAPI
from fastapi_slack import SlashCommand, router
app = FastAPI()
app.include_router(router)
@app.post("/slash-commands")
def process_commands(slash_command: SlashCommand = Depends()):
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.1.tar.gz
(4.0 kB
view hashes)
Built Distribution
Close
Hashes for fastapi_slack-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f2df02c67c3bcfc399922c79867f010c8a6c618caa61a9e69be32af7ad2be03 |
|
MD5 | 212a4ed6bc7a4fb0a1820af6f3b68078 |
|
BLAKE2b-256 | 8af21af31c9a0859d8844f1557001a62ab00b04f5a53ecbcb1a87da8b9f615ef |