Async Rust client for Epic Online Services and Fortnite.
Note
rustfn is currently in the development and testing phase. Everything is actively being tested and refined.
- Device code sign-in and saved DeviceAuth credentials.
- Friends, direct messages, and presence.
- Parties, invitations, party chat, and bot commands.
Requires Rust 1.88 or newer. Add rustfn to your project:
cargo add rustfnFor the example below, add this to Cargo.toml:
[dependencies]
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }Save this as src/main.rs:
use rustfn::commands::Bot;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
Bot::new("!")
.on_ready(|bot| async move {
println!("Bot ready as {}", bot.user.display_name);
})
.on_friend_request(|request| async move {
if request.is_inbound() {
request.accept().await?;
}
Ok(())
})
.command("hello", |ctx| async move { ctx.send("Hello!").await })
.command("ping", |ctx| async move { ctx.send("Pong!").await })
.run()
.await?;
Ok(())
}Run cargo run. On first run, complete Epic's device authorization. The bot saves generated DeviceAuth credentials under ./device_auth/ for later runs; keep that directory private. Send !hello or !ping to try the commands.
MIT.