Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cloud303-cholden/rs-slack
Simple Slack SDK for Rust.
https://github.com/cloud303-cholden/rs-slack
Last synced: 1 day ago
JSON representation
Simple Slack SDK for Rust.
- Host: GitHub
- URL: https://github.com/cloud303-cholden/rs-slack
- Owner: cloud303-cholden
- License: apache-2.0
- Created: 2023-12-08T17:42:14.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-29T18:52:32.000Z (about 1 year ago)
- Last Synced: 2025-01-28T07:02:01.075Z (9 days ago)
- Language: Rust
- Homepage:
- Size: 56.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Slack SDK
An unofficial Slack SDK for Rust. This library is not affiliated with Slack. It is for personal use and experimentation. Use at your own risk.## Example
```rust
use slack::{
Client,
api::{
Chat,
input,
},
};#[tokio::main]
async fn main() -> Result<(), Box> {
let client = Client::new("xoxb-000000000000-0000000000-000000000000000000000000");// API clients and inputs can be created and reused.
let chat = client.api::();
let post_message = input::PostMessage {
channel: "C0000000000",
text: "Test",
thread_ts: None,
};
// Inputs can be passed by value and by reference.
chat.post_message(&post_message).await?;
chat.post_message(post_message).await?;// Alternatively, make the entire request in a single statement.
client
.api::()
.post_message(input::PostMessage {
channel: "C0000000000",
text: "Test",
thread_ts: None,
}).await?
Ok(())
}
```