2014-12-19 16:48:59 +01:00
|
|
|
# irc [![Build Status](https://travis-ci.org/aatxe/irc.svg?branch=master)](https://travis-ci.org/aatxe/irc) #
|
2014-12-02 18:26:50 +01:00
|
|
|
A thread-safe IRC library in Rust based on iterators. It's hopefully compliant with
|
|
|
|
[RFC 2812](http://tools.ietf.org/html/rfc2812). You can find up-to-date, ready-to-use documentation
|
2014-12-19 17:40:12 +01:00
|
|
|
online [here](http://www.rust-ci.org/aatxe/irc/doc/irc/). The documentation is generated
|
2015-01-01 02:40:11 +01:00
|
|
|
with the default features. These are, however, strictly optional and can be disabled by the
|
|
|
|
end-user.
|
2014-12-02 18:26:50 +01:00
|
|
|
|
|
|
|
## Getting Started ##
|
|
|
|
|
|
|
|
To start using this library with cargo, you can simply add `irc = "*"` to your dependencies to your
|
|
|
|
Cargo.toml file. From there, you can look to the examples and the documentation to see how to
|
|
|
|
proceed. Making a simple bot is easy though:
|
|
|
|
|
|
|
|
```rust
|
2014-12-05 16:27:58 +01:00
|
|
|
extern crate irc;
|
|
|
|
|
|
|
|
use irc::server::{IrcServer, Server};
|
|
|
|
use irc::server::utils::Wrapper;
|
|
|
|
|
2014-12-02 18:26:50 +01:00
|
|
|
fn main() {
|
2014-12-05 16:27:58 +01:00
|
|
|
let irc_server = IrcServer::new("config.json").unwrap();
|
2014-12-02 18:26:50 +01:00
|
|
|
let server = Wrapper::new(&irc_server);
|
|
|
|
server.identify().unwrap();
|
|
|
|
for message in server.iter() {
|
2014-12-05 16:27:58 +01:00
|
|
|
// Do message processing.
|
2014-12-02 18:26:50 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
2014-11-05 08:11:33 +01:00
|
|
|
|
|
|
|
## Contributing ##
|
2014-12-02 18:26:50 +01:00
|
|
|
Contributions to this library would be immensely appreciated. As this project is public domain,
|
|
|
|
all prospective contributors must
|
|
|
|
[sign the Contributor License Agreement](https://www.clahub.com/agreements/aaronweiss74/irc), a
|
|
|
|
public domain dedication.
|