Crates.io | gitter |
lib.rs | gitter |
version | 0.4.0 |
source | src |
created_at | 2017-05-15 18:47:50.070252 |
updated_at | 2018-03-14 12:43:32.294657 |
description | A library that provides Gitter API |
homepage | https://github.com/shmutalov/gitter-rs |
repository | https://github.com/shmutalov/gitter-rs |
max_upload_size | |
id | 14732 |
size | 47,014 |
Gitter API in Rust
cargo build
[dependencies]
gitter = "0.4.0"
[dependencies]
gitter = { git = "https://github.com/shmutalov/gitter-rs" }
extern crate gitter;
use gitter::Gitter;
...
let api = Gitter::new("YOUR_ACCESS_TOKEN").unwrap();
Following code snippets did not updated yet
let user = api.get_user().unwrap();
// Get all rooms
let rooms = api.get_rooms().unwrap();
// Get room by id
let room = api.get_room("roomID").unwrap();
// Get rooms of some user
let rooms = api.get_rooms("userID").unwrap();
// Join room
let room = api.join_room("roomID", "userID").unwrap();
// Leave room
let room = api.leave_room("roomID", "userID").unwrap();
// Get room id
let room_id = api.get_room_id("room/uri").unwrap();
// Search gitter rooms
let rooms = api.search_rooms("search/string").unwrap();
// Get messages of room
let messages = api.get_messages("roomID", None).unwrap();
// Get one message
let message = api.get_message("roomID", "messageID").unwrap();
// Send message
api.send_message("roomID", "free chat text").unwrap();
This project is a work in progress.
send_message
methodgitter-rs
is distributed under the terms of both the MIT license and the Apache License (Version 2.0).
See LICENSE-APACHE
and LICENSE-MIT
for details.