Merge pull request #10 from reminder-bot/jellywx/fix-dm-reminders
group by channel instead of guild
This commit is contained in:
commit
6708abdb0f
@ -292,22 +292,21 @@ INNER JOIN
|
|||||||
ON
|
ON
|
||||||
reminders.channel_id = channels.id
|
reminders.channel_id = channels.id
|
||||||
WHERE
|
WHERE
|
||||||
reminders.id IN (
|
reminders.`id` IN (
|
||||||
SELECT
|
SELECT
|
||||||
MIN(reminders.id)
|
MIN(id)
|
||||||
FROM reminders
|
FROM
|
||||||
INNER JOIN
|
reminders
|
||||||
channels
|
WHERE
|
||||||
ON reminders.channel_id = channels.id
|
reminders.`utc_time` <= NOW()
|
||||||
WHERE reminders.`utc_time` < NOW()
|
AND (
|
||||||
GROUP BY channels.guild_id
|
reminders.`interval_seconds` IS NOT NULL
|
||||||
|
OR reminders.`interval_months` IS NOT NULL
|
||||||
|
OR reminders.enabled
|
||||||
|
)
|
||||||
|
GROUP BY channel_id
|
||||||
)
|
)
|
||||||
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
|
||||||
|
Loading…
Reference in New Issue
Block a user