1.4.6- natural arguments can now be on new lines and work properly
This commit is contained in:
@ -978,6 +978,22 @@ impl Content {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
#[command("countdown")]
|
||||
#[permission_level(Managed)]
|
||||
async fn countdown(ctx: &Context, msg: &Message, args: String) {
|
||||
if !check_subscription_on_message(&ctx, &msg).await {
|
||||
} else {
|
||||
let (pool, lm) = get_ctx_data(&ctx).await;
|
||||
let split_args = args.splitn(3, ' ').collect::<Vec<&str>>();
|
||||
|
||||
if split_args.len() == 3 {
|
||||
} else {
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
#[command("remind")]
|
||||
#[permission_level(Managed)]
|
||||
async fn remind(ctx: &Context, msg: &Message, args: String) {
|
||||
|
@ -57,14 +57,14 @@ lazy_static! {
|
||||
.unwrap();
|
||||
|
||||
pub static ref REGEX_NATURAL_COMMAND_1: Regex = RegexBuilder::new(
|
||||
r#"(?P<time>.*?) (?:send|say) (?P<msg>.*?)(?: to (?P<mentions>((?:<@\d+>)|(?:<@!\d+>)|(?:<#\d+>)|(?:\s+))+))?$"#
|
||||
r#"(?P<time>.*?)(?:\s+)(?:send|say)(?:\s+)(?P<msg>.*?)(?:(?:\s+)to(?:\s+)(?P<mentions>((?:<@\d+>)|(?:<@!\d+>)|(?:<#\d+>)|(?:\s+))+))?$"#
|
||||
)
|
||||
.dot_matches_new_line(true)
|
||||
.build()
|
||||
.unwrap();
|
||||
|
||||
pub static ref REGEX_NATURAL_COMMAND_2: Regex = RegexBuilder::new(
|
||||
r#"(?P<msg>.*) every (?P<interval>.*?)(?: (?:until|for) (?P<expires>.*?))?$"#
|
||||
r#"(?P<msg>.*)(?:\s+)every(?:\s+)(?P<interval>.*?)(?:(?:\s+)(?:until|for)(?:\s+)(?P<expires>.*?))?$"#
|
||||
)
|
||||
.dot_matches_new_line(true)
|
||||
.build()
|
||||
|
Reference in New Issue
Block a user