slack-events
Typed Slack events, dispatch, and bot reply helpers.
pip install slack-events
pip install 'slack-events[fastapi,client]'
The Python import is slack_events. The base package depends only on typing-extensions;
pydantic, fastapi, and client extras enable validation, HTTP routing, and the
Slack SDK client respectively.
Responding with Block Kit
Thread.post, Message.reply, SlashCommand.respond, Action.respond, and
string returns from SlackBot command handlers accept standard Markdown.
They send a markdown block and top-level text containing the same content for
notifications and screen readers. Slack performs the Markdown conversion.
post_stream uses Slack's native Markdown streaming protocol; its post-and-edit
fallback sends blocks on both the initial post and every update.
await message.reply("## Results\n**Done.** See [the report](https://example.com).")
Use explicit blocks= for interactive layouts, structured rich_text, or legacy
Slack mrkdwn. In this case text is your accessible fallback and should contain
all necessary information. Explicit blocks are passed through unchanged; []
is an intentional opt-out. Raw dictionary returns and the low-level dispatcher
also remain caller-controlled.
message_payload(text, blocks=...) exposes the same policy to response layers
that call Slack directly. Generated Markdown is capped at Slack's cumulative
12,000-character limit, with a visible truncation notice. Applications can use
truncate_markdown to reserve room for a link to the full response. Callers
supplying their own blocks are responsible for block limits and content.
Slack's references:
- Markdown blocks for LLM output
- Rich text for structured user-authored content
- Fallback text and accessibility
- Streaming finalization
In mo, finalized replies replace the complete message with Markdown blocks after
stopping a native stream. Blocks passed to chat.stopStream would be appended to
the streamed content, so that method is not used to replace the answer.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file slack_events-0.1.0.tar.gz.
File metadata
- Download URL: slack_events-0.1.0.tar.gz
- Upload date:
- Size: 33.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf281a73024184c41d952c65cb1ba14fb4dfe33300cec9fe925d0f7e766c4f2c
|
|
| MD5 |
6da5108fd5daded342f568d0ea119f16
|
|
| BLAKE2b-256 |
7a163930e3725f88e5d0433c7811236668343a6ce63d2005ac038d2fc180ca99
|
File details
Details for the file slack_events-0.1.0-py3-none-any.whl.
File metadata
- Download URL: slack_events-0.1.0-py3-none-any.whl
- Upload date:
- Size: 39.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1b0b50201615b61914fca3142ebd497ccf867f1cb534b0ffa2002092459fca8
|
|
| MD5 |
2a7f3e9f1630eb67e68c68d8697fbe2b
|
|
| BLAKE2b-256 |
ed83431c372b1e63a650fb1e687e37238646e061d84b8f9fbd030d71ce2cfdd2
|