slack-web-api 0.1.1

SlackWebAPI for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use slack_web_api::api::{SlackApiFilesUploadRequest};
use slack_web_api::{SlackClient};

#[tokio::test]
async fn test() {
    let token = std::env::var("SLACK_TOKEN_TEST").unwrap();
    let channel = "test-chanel";
    let client = SlackClient::new(token.as_str());

    let res = client.files_upload(&SlackApiFilesUploadRequest {
        channels: Some(channel.to_string()),
        file: Some("./test.txt".to_string()),
        ..SlackApiFilesUploadRequest::default()
    }).await;
    assert!(res.is_ok());
    // dbg!(res).expect(" panic message");
}