diff --git a/README.md b/README.md index 401b906..40eb22a 100644 --- a/README.md +++ b/README.md @@ -10,21 +10,21 @@ Simply do `cargo build --release`. It might take a while. ##### Step 2 - Write the Script that Igneous should follow The script format is simple. There are 3 command types: -`S!bot? are you there?` - wait for user to type the preset string ("bot? are you there?") -`I!yeah, I'm here` - reply with the preset string ("yeah, I'm here") -`IMG![images/bot-selfie.png]` - reply with image +- `T!bot? are you there?` - wait for anyone (including other bots) to type the preset string "bot? are you there?" +- `R!yeah, I'm here` - reply with the preset string "yeah, I'm here" +- `IMG![images/bot-selfie.png]` - reply with image All commands **must** have a timeout (the timeout **can** be `0.0`) after the command executes: -`S!bot? are you there?+3.0` - wait 3 seconds after the user types the preset string +`T!bot? are you there?+3.0` - wait 3 seconds after the user types the preset string -Always start a bot with an `S!`. That would be your trigger. +If the first command is a trigger, then the bot will only become active when the requirement for input is met. Otherwise, any message will activate the bot. A simple ping-pong bot: ``` -S!bot? are you there?+2.0 -I!yeah, I'm here+0.0 -S!ok+2.0 -I!soooooo, why did you call me?+0.0 +T!bot? are you there?+2.0 +R!yeah, I'm here+0.0 +T!ok+2.0 +R!soooooo, why did you call me?+0.0 IMG![Confused.png]+0.0 ``` diff --git a/src/lib.rs b/src/lib.rs index bc372a3..ea3f35c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -66,10 +66,9 @@ impl Handler { let timeout: String = matched.get(3).unwrap().as_str().to_owned(); let timeout: f32 = timeout.parse().unwrap(); states.push(match cmd_type.as_str() { - "I" => State::Display(data, timeout), - "S" => State::Trigger(Requirement::new(data), timeout), + "R" => State::Display(data, timeout), "IMG" => State::DisplayImage(data, timeout), - "INPUT" => State::Trigger(Requirement::new(data), timeout), + "T" => State::Trigger(Requirement::new(data), timeout), "GO_OFFLINE" => State::GoOffline(timeout), "GO_ONLINE" => State::GoOnline(timeout), &_ => {