Add cron parser for start time of a reminder
This commit is contained in:
@@ -16,7 +16,7 @@ use crate::{
|
||||
},
|
||||
CtxData,
|
||||
},
|
||||
time_parser::natural_parser,
|
||||
time_parser::{cron_next_timestamp, natural_parser},
|
||||
utils::{check_guild_subscription, check_subscription},
|
||||
Context, Database, Error,
|
||||
};
|
||||
@@ -486,7 +486,10 @@ pub async fn create_reminder(
|
||||
let user_data = ctx.author_data().await.unwrap();
|
||||
let timezone = timezone.unwrap_or(ctx.timezone().await);
|
||||
|
||||
let time = natural_parser(&time, &timezone.to_string()).await;
|
||||
let time = match cron_next_timestamp(&time, timezone) {
|
||||
Some(ts) => Some(ts),
|
||||
None => natural_parser(&time, &timezone.to_string()).await,
|
||||
};
|
||||
|
||||
match time {
|
||||
Some(time) => {
|
||||
|
||||
Reference in New Issue
Block a user