All Projects → aatxe → Irc

aatxe / Irc

Licence: mpl-2.0
the irc crate – usable, async IRC for Rust

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Irc

Honeybot
🛩 A python IRC bot with simple plugins dev. Ignited in mauritius, first-timers friendly!
Stars: ✭ 48 (-88.26%)
Mutual labels:  irc, client
Graphql Ws
Coherent, zero-dependency, lazy, simple, GraphQL over WebSocket Protocol compliant server and client.
Stars: ✭ 398 (-2.69%)
Mutual labels:  protocol, client
Ircdotnet
IRC.NET is a complete IRC (Internet Relay Chat) client library for .NET.
Stars: ✭ 166 (-59.41%)
Mutual labels:  irc, protocol
Gophertunnel
Toolbox for Minecraft software written in Go
Stars: ✭ 156 (-61.86%)
Mutual labels:  protocol, client
Telebot.nim
Async client for Telegram Bot API in pure Nim [Bot API 5.1]
Stars: ✭ 93 (-77.26%)
Mutual labels:  async, client
Quarry
Python library that implements the Minecraft network protocol and data types
Stars: ✭ 182 (-55.5%)
Mutual labels:  protocol, client
Twisted
Event-driven networking engine written in Python.
Stars: ✭ 4,442 (+986.06%)
Mutual labels:  async, irc
Weechat
The extensible chat client.
Stars: ✭ 2,349 (+474.33%)
Mutual labels:  irc, client
Gitter Api
[production-ready] Gitter API implementation for php 7.0+ allowing sync, async and streaming access.
Stars: ✭ 11 (-97.31%)
Mutual labels:  async, client
Ws Promise Client
PROJECT MOVED: https://github.com/kdex/ws-promise
Stars: ✭ 6 (-98.53%)
Mutual labels:  async, client
Jstp
Fast RPC for browser and Node.js based on TCP, WebSocket, and MDSF
Stars: ✭ 132 (-67.73%)
Mutual labels:  protocol, client
Pyrogram
Telegram MTProto API Client Library and Framework in Pure Python for Users and Bots
Stars: ✭ 2,252 (+450.61%)
Mutual labels:  async, client
Node Minecraft Protocol
Parse and serialize minecraft packets, plus authentication and encryption.
Stars: ✭ 697 (+70.42%)
Mutual labels:  protocol, client
Kiwiirc
🥝 Next generation of the Kiwi IRC web client
Stars: ✭ 488 (+19.32%)
Mutual labels:  irc, client
Vibora
Fast, asynchronous and elegant Python web framework.
Stars: ✭ 5,734 (+1301.96%)
Mutual labels:  async, client
Socket
Non-blocking socket and TLS functionality for PHP based on Amp.
Stars: ✭ 122 (-70.17%)
Mutual labels:  async, client
Stripe
Typed .NET clients for stripe.com REST APIs
Stars: ✭ 193 (-52.81%)
Mutual labels:  async, client
Mumble
Mumble is an open-source, low-latency, high quality voice chat software.
Stars: ✭ 4,418 (+980.2%)
Mutual labels:  client
Dutier
The immutable, async and hybrid state management solution for Javascript applications.
Stars: ✭ 401 (-1.96%)
Mutual labels:  async
Btorrent
🌐 Fully-featured WebTorrent Client
Stars: ✭ 388 (-5.13%)
Mutual labels:  client

the irc crate Build Status Crates.io Downloads Docs

"the irc crate" is a thread-safe and async-friendly IRC client library written in Rust. It's compliant with RFC 2812, IRCv3.1, IRCv3.2, and includes some additional, common features from popular IRCds. You can find up-to-date, ready-to-use documentation online on docs.rs.

Built with the irc crate

the irc crate is being used to build new IRC software in Rust. Here are some of our favorite projects:

Making your own project? Submit a pull request to add it!

Getting Started

To start using the irc crate with cargo, you can add irc = "0.13" to your dependencies in your Cargo.toml file. The high-level API can be found in irc::client::prelude. You'll find a number of examples to help you get started in examples/, throughout the documentation, and below.

Using Futures

The release of v0.14 replaced all existing APIs with one based on async/await.

use irc::client::prelude::*;
use futures::prelude::*;

#[tokio::main]
async fn main() -> Result<(), failure::Error> {
    // We can also load the Config at runtime via Config::load("path/to/config.toml")
    let config = Config {
        nickname: Some("the-irc-crate".to_owned()),
        server: Some("chat.freenode.net".to_owned()),
        channels: Some(vec!["#test".to_owned()]),
        ..Config::default()
    };

    let mut client = Client::from_config(config).await?;
    client.identify()?;

    let mut stream = client.stream()?;

    while let Some(message) = stream.next().await.transpose()? {
        print!("{}", message);
    }

    Ok(())
}

Configuring IRC Clients

As seen above, there are two techniques for configuring the irc crate: runtime loading and programmatic configuration. Runtime loading is done via the function Config::load, and is likely sufficient for most IRC bots. Programmatic configuration is convenient for writing tests, but can also be useful when defining your own custom configuration format that can be converted to Config. The primary configuration format is TOML, but if you are so inclined, you can use JSON and/or YAML via the optional json_config and yaml_config features respectively. At the minimum, a configuration requires nickname and server to be defined, and all other fields are optional. You can find detailed explanations of the various fields on docs.rs.

Alternatively, you can look at the example below of a TOML configuration with all the fields:

owners = []
nickname = "user"
nick_password = "password"
alt_nicks = ["user_", "user__"]
username = "user"
realname = "Test User"
server = "chat.freenode.net"
port = 6697
password = ""
proxy_type = "None"
proxy_server = "127.0.0.1"
proxy_port = "1080"
proxy_username = ""
proxy_password = ""
use_tls = true
cert_path = "cert.der"
client_cert_path = "client.der"
client_cert_pass = "password"
encoding = "UTF-8"
channels = ["#rust", "#haskell", "#fake"]
umodes = "+RB-x"
user_info = "I'm a test user for the irc crate."
version = "irc:git:Rust"
source = "https://github.com/aatxe/irc"
ping_time = 180
ping_timeout = 10
burst_window_length = 8
max_messages_in_burst = 15
should_ghost = false
ghost_sequence = []

[channel_keys]
"#fake" = "password"

[options]
note = "anything you want can be in here!"
and = "you can use it to build your own additional configuration options."
key = "value"

You can convert between different configuration formats with convertconf like so:

cargo run --example convertconf -- -i client_config.json -o client_config.toml

Note that the formats are automatically determined based on the selected file extensions. This tool should make it easier for users to migrate their old configurations to TOML.

Contributing

the irc crate is a free, open source library that relies on contributions from its maintainers, Aaron Weiss (@aatxe) and Peter Atashian (@retep998), as well as the broader Rust community. It's licensed under the Mozilla Public License 2.0 whose text can be found in LICENSE.md. To foster an inclusive community around the irc crate, we have adopted a Code of Conduct whose text can be found in CODE_OF_CONDUCT.md. You can find details about how to contribute in CONTRIBUTING.md.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].