From 2db405866fd9dc29deb1e54b527e0133b30c203e Mon Sep 17 00:00:00 2001 From: jellywx Date: Mon, 28 Dec 2020 21:31:52 +0000 Subject: [PATCH] fix interval/donor message not showing --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/commands/reminder_cmds.rs | 24 +++++++++++++++++++----- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index abe0811..8cc3fc3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1316,7 +1316,7 @@ dependencies = [ [[package]] name = "reminder_rs" -version = "1.3.2" +version = "1.3.3" dependencies = [ "Inflector", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index fae2274..085df17 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "reminder_rs" -version = "1.3.2" +version = "1.3.3" authors = ["jellywx "] edition = "2018" diff --git a/src/commands/reminder_cmds.rs b/src/commands/reminder_cmds.rs index 32e1e40..09f721b 100644 --- a/src/commands/reminder_cmds.rs +++ b/src/commands/reminder_cmds.rs @@ -988,11 +988,7 @@ async fn remind(ctx: &Context, msg: &Message, args: String) { #[command("interval")] #[permission_level(Managed)] async fn interval(ctx: &Context, msg: &Message, args: String) { - if check_subscription_on_message(&ctx, msg).await { - remind_command(ctx, msg, args, RemindCommand::Interval).await; - } else { - let _ = msg.channel_id.say(&ctx, "interval/donor").await; - } + remind_command(ctx, msg, args, RemindCommand::Interval).await; } fn parse_mention_list(mentions: &str) -> Vec { @@ -1016,6 +1012,24 @@ async fn remind_command(ctx: &Context, msg: &Message, args: String, command: Rem let user_data = UserData::from_user(&msg.author, &ctx, &pool).await.unwrap(); + if command == RemindCommand::Interval { + if !check_subscription_on_message(&ctx, msg).await { + // breaker + let _ = msg + .channel_id + .say( + &ctx, + lm.get(&user_data.language, "interval/donor").replace( + "{prefix}", + &GuildData::prefix_from_id(msg.guild_id, &pool).await, + ), + ) + .await; + + return; + } + } + let captures = match command { RemindCommand::Remind => REGEX_REMIND_COMMAND.captures(&args),