Slack Morphism for Rust
Slack Morphism is a modern client library for Slack Web/Events API and Block Kit.
Slack Web API client
Create a client instance:
use *;
let client = new;
Make Web API methods calls
For most of Slack Web API methods (except for OAuth methods, Incoming Webhooks and event replies) you need a Slack token to make a call. For simple bots you can have it in your config files, or you can obtain workspace tokens using Slack OAuth.
In the example below, we’re using a hardcoded Slack token, but don’t do that for your production bots and apps. You should securely and properly store all of Slack tokens.
use *;
use *;
use *;
# async
Events API and OAuth support
The library provides route implementation in SlackClientEventsListener
based on Hyper/Tokio for:
- Push Events
- Interaction Events
- Command Events
- OAuth v2 redirects and client functions
You can chain all of the routes using chain_service_routes_fn
from the library.
Also the library provides Slack events signature verifier (SlackEventSignatureVerifier
)
(which is already integrated in the routes implementation for you).
All you need is provide your client id and secret configuration to route implementation.
Look at the examples/test_server sources for the details.
Docs
Please follow to the official website: https://slack-rust.abdolence.dev