From 19b3eb067e1adc4d9d9ff31174a50f2cabeef557 Mon Sep 17 00:00:00 2001 From: jude Date: Mon, 26 Oct 2020 10:16:38 +0000 Subject: [PATCH] fix for multiline commands --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/framework.rs | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9b7f02b..7297d81 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1179,7 +1179,7 @@ dependencies = [ [[package]] name = "reminder_rs" -version = "1.0.1" +version = "1.0.2" dependencies = [ "Inflector", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index c7731c9..38f49ac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "reminder_rs" -version = "1.0.1" +version = "1.0.2" authors = ["jellywx "] edition = "2018" diff --git a/src/framework.rs b/src/framework.rs index 1313a03..3ab9646 100644 --- a/src/framework.rs +++ b/src/framework.rs @@ -245,6 +245,7 @@ impl RegexFramework { self.command_matcher = RegexBuilder::new(match_string.as_str()) .case_insensitive(self.case_insensitive) + .dot_matches_new_line(true) .build() .unwrap(); } @@ -278,6 +279,7 @@ impl RegexFramework { self.dm_regex_matcher = RegexBuilder::new(match_string.as_str()) .case_insensitive(self.case_insensitive) + .dot_matches_new_line(true) .build() .unwrap(); } @@ -350,7 +352,7 @@ impl Framework for RegexFramework { { let member = guild.member(&ctx, &msg.author).await.unwrap(); - if let Some(full_match) = self.command_matcher.captures(&msg.content[..]) { + if let Some(full_match) = self.command_matcher.captures(&msg.content) { if check_prefix(&ctx, &guild, full_match.name("prefix")).await { let pool = ctx .data