From 9003beb1bb9781e3ef27848d119e22e8f53ac3fb Mon Sep 17 00:00:00 2001 From: jellywx Date: Tue, 19 Jan 2021 12:01:14 +0000 Subject: [PATCH] fix multiline reminders. disable unused gateways if dm disabled --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/consts.rs | 14 ++++++++++---- src/main.rs | 14 ++++++++++---- 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6f9fd2f..467d253 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1314,7 +1314,7 @@ dependencies = [ [[package]] name = "reminder_rs" -version = "1.4.0" +version = "1.4.1" dependencies = [ "Inflector", "chrono", diff --git a/Cargo.toml b/Cargo.toml index aea3116..db3cc76 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "reminder_rs" -version = "1.4.0" +version = "1.4.1" authors = ["jellywx "] edition = "2018" diff --git a/src/consts.rs b/src/consts.rs index 34037e1..778b402 100644 --- a/src/consts.rs +++ b/src/consts.rs @@ -33,7 +33,7 @@ const THEME_COLOR_FALLBACK: u32 = 0x8fb677; use std::{collections::HashSet, env, iter::FromIterator}; -use regex::Regex; +use regex::{Regex, RegexBuilder}; lazy_static! { pub static ref REGEX_CHANNEL: Regex = Regex::new(r#"^\s*<#(\d+)>\s*$"#).unwrap(); @@ -49,19 +49,25 @@ lazy_static! { pub static ref REGEX_CHANNEL_USER: Regex = Regex::new(r#"\s*<(#|@)(?:!)?(\d+)>\s*"#).unwrap(); - pub static ref REGEX_REMIND_COMMAND: Regex = Regex::new( + pub static ref REGEX_REMIND_COMMAND: Regex = RegexBuilder::new( r#"(?P(?:<@\d+>\s|<@!\d+>\s|<#\d+>\s)*)(?P