Don't send non-interval disabled reminders

Skip the sending logic as some users use disabled one-time reminders as presets
This commit is contained in:
jude 2022-08-04 19:06:29 +01:00
parent 7b6e967a5d
commit 25b84880a5
4 changed files with 14 additions and 4 deletions

2
Cargo.lock generated
View File

@ -2068,7 +2068,7 @@ checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244"
[[package]] [[package]]
name = "reminder_rs" name = "reminder_rs"
version = "1.6.2" version = "1.6.3"
dependencies = [ dependencies = [
"base64", "base64",
"chrono", "chrono",

View File

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

View File

@ -157,4 +157,9 @@ CREATE TABLE events (
FOREIGN KEY (reminder_id) REFERENCES reminders_new(id) ON DELETE SET NULL FOREIGN KEY (reminder_id) REFERENCES reminders_new(id) ON DELETE SET NULL
); );
DROP TABLE reminders;
DROP TABLE embed_fields;
RENAME TABLE reminders_new TO reminders;
RENAME TABLE embed_fields_new TO embed_fields;
SET FOREIGN_KEY_CHECKS = 1; SET FOREIGN_KEY_CHECKS = 1;

View File

@ -301,8 +301,13 @@ WHERE
ON reminders.channel_id = channels.id ON reminders.channel_id = channels.id
WHERE reminders.`utc_time` < NOW() WHERE reminders.`utc_time` < NOW()
GROUP BY channels.guild_id GROUP BY channels.guild_id
) AND )
reminders.`utc_time` < NOW()"#, AND reminders.`utc_time` < NOW()
AND (
reminders.`interval_seconds` IS NOT NULL
OR reminders.`interval_months` IS NOT NULL
OR reminders.enabled
)"#,
) )
.fetch_all(pool) .fetch_all(pool)
.await .await