Slackette
Slackette is a modern small tooklit for building Slack applications
Examples
Use webhook to publish BlockKit messages
from slackette import SlackWebhook
from slackette.blocks import *
webhook = SlackWebhook("YOUR SLACK WEBHOOK")
webhook(
Blocks(
blocks=[
Section(
text=Markdown(text="**hello**"),
)
]
)
)
# Or simply
webhook(MarkdownBlocks(":warning: i am a lazy dude"))Implement a interactive callback with FastAPI
from fastapi import FastAPI, Request
from pydantic import BaseSettings
from slackette.security import SlackRequest
class Settings(BaseSettings):
SLACK_SIGNING_SECRET: str
settings = Settings()
api = FastAPI()
@api.post("/slack")
@verify_slack_signature(signing_secret=settings.SLACK_SIGNING_SECRET)
def on_interactive_event(request: Request) -> None:
...On this page
Created September 29, 2022
Updated September 29, 2022