fix interval/donor message not showing

This commit is contained in:
jellywx 2020-12-28 21:31:52 +00:00
parent 684661af42
commit 2db405866f
3 changed files with 21 additions and 7 deletions

2
Cargo.lock generated
View File

@ -1316,7 +1316,7 @@ dependencies = [
[[package]]
name = "reminder_rs"
version = "1.3.2"
version = "1.3.3"
dependencies = [
"Inflector",
"async-trait",

View File

@ -1,6 +1,6 @@
[package]
name = "reminder_rs"
version = "1.3.2"
version = "1.3.3"
authors = ["jellywx <judesouthworth@pm.me>"]
edition = "2018"

View File

@ -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;
}
}
fn parse_mention_list(mentions: &str) -> Vec<ReminderScope> {
@ -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),