0248df4d90
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
20 lines
492 B
Rust
20 lines
492 B
Rust
use horizon_mod_sdk::{Mod, Registration, chat};
|
|
|
|
struct MyMod {
|
|
greeted: u32,
|
|
}
|
|
|
|
impl Mod for MyMod {
|
|
fn init() -> Result<(Self, Registration), String> {
|
|
Ok((MyMod { greeted: 0 }, Registration::new().command("hello")))
|
|
}
|
|
|
|
fn command(&mut self, _name: &str, args: &str) -> Result<Option<String>, String> {
|
|
self.greeted += 1;
|
|
chat::show(&format!("Hello {args}! ({} so far)", self.greeted));
|
|
Ok(None)
|
|
}
|
|
}
|
|
|
|
horizon_mod_sdk::export_mod!(MyMod);
|