Crate xdcc_request

Source
Expand description

§xdcc-request

Crates.io Docs.rs

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


§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.

Structs§

Engine
A clonable interface to create and manage IRC XDCC requests.
Request
A single XDCC request created from an Engine.
RequestInfo
Information needed to perform a XDCC request.
Response
Represents a parsed DCC SEND response from the IRC bot.