diff --git a/src/commands/cmd_macro.rs b/src/commands/cmd_macro.rs index 6f9fd38..7a2a03b 100644 --- a/src/commands/cmd_macro.rs +++ b/src/commands/cmd_macro.rs @@ -6,8 +6,6 @@ use serenity::{ }; extern crate serde_json; -//use serde::{Deserialize, Serialize}; -use serde_json::Result; extern crate regex; use regex::{Regex, RegexBuilder, Match}; @@ -88,7 +86,7 @@ impl CmdMacro { let macros: HashMap> = serde_json::from_reader(reader).unwrap_or(HashMap::>::new()); return CmdMacro { format: - RegexBuilder::new(r#"^!macro\s+([A-Za-z0-9]+|"[^\s]+"|'[^\s]+')(?:\s+([A-Za-z0-9]+|"[^\s]+"|'[^\s]+')\s+(.+))?"#) + RegexBuilder::new(r#"^!macro\s+([A-Za-z0-9]+|"[^\s]+"|'[^\s]+')(?:\s+([A-Za-z0-9]+|"[^\s]+"|'[^\s]+'))?(?:\s+(.+))?"#) .multi_line(true) .dot_matches_new_line(true) .case_insensitive(true) diff --git a/src/main.rs b/src/main.rs index 7c2ce4d..10960e7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -57,7 +57,7 @@ fn main() { println!("Leo42 v{} is starting in {}", crate_version!(), env::current_dir().unwrap().to_str().unwrap()); let token = env::var("DISCORD_TOKEN") .expect("Expected a Discord API token in DISCORD_TOKEN environment variable"); - let mut event_handler = Handler::new(); + let event_handler = Handler::new(); // register commands; let mut commands = std::vec::Vec::>::new(); commands.push(Box::new(commands::CmdMacro::new()));