teamtalk 6.0.0

TeamTalk SDK for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#[cfg(feature = "scripts")]
use teamtalk::extensions::scripts::ScriptManager;

#[cfg(feature = "scripts")]
fn main() -> Result<(), Box<dyn std::error::Error>> {
    let mut manager = ScriptManager::new();
    manager.load_script("commands", "crates/teamtalk/examples/scripts/commands.lua")?;
    let handled = manager.call_command("start", &["channel".to_string()])?;
    println!("handled: {}", handled);
    Ok(())
}

#[cfg(not(feature = "scripts"))]
fn main() {
    eprintln!("Enable scripts feature: cargo run --example lua_script_commands --features scripts");
}