1 unstable release
Uses new Rust 2024
| 0.1.0 | May 27, 2025 |
|---|
#2 in #nickname
13KB
211 lines
xdcc-request
Asynchronous XDCC (X Direct Client-to-Client) request library for Rust.
xdcc-request lets you interact with IRC bots that support XDCC to programmatically request files. It handles IRC connections, nickname generation, and DCC SEND message parsing, all in a clean, async interface.
Features
- Connects to IRC servers and joins channels.
- Sends XDCC commands to bots.
- Parses and extracts DCC SEND responses (filename, IP, port, file size).
- Timeout handling and nickname generation included.
Example
# Cargo.toml
[dependencies]
xdcc-request = "0.1"
tokio = { version = "1", features = ["full"] }
use xdcc_request::Engine;
#[tokio::main]
async fn main() {
let engine = Engine::default();
let request = engine.create_request(
"irc.example.net",
"#channel",
"BotNick",
123, // XDCC pack number
);
match request.execute().await {
Ok(response) => {
println!("Filename: {}", response.filename);
println!("Address: {}", response.address);
println!("Port: {}", response.port);
println!("Filesize: {}", response.filesize);
}
Err(e) => eprintln!("XDCC request failed: {:?}", e),
}
}
Documentation
Full API docs available at docs.rs/xdcc-request
License
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
Disclaimer
This library is for educational and legal use only. Use responsibly and only on servers and with bots where you have permission to interact.
Dependencies
~5–17MB
~173K SLoC