Receipts: Split dev and production channels.

Fix missing date utils import
This commit is contained in:
2026-02-03 11:15:05 +01:00
parent 1b3b498723
commit f17cdb12c0
2 changed files with 11 additions and 8 deletions

View File

@@ -1,9 +1,11 @@
const { formatDate } = require('../core/utils.js');
module.exports = {
timeout: 10000,
immediate: true,
name: 'Receipt Day Announcements',
data: {
channelId: '1462060674766344370',
channelId: process.env.NODE_ENV === 'development' ? '1468186493251227658' : '1462060674766344370',
targetHour: 0,
targetMinute: 1
},
@@ -55,25 +57,25 @@ module.exports = {
const notification = db.prepare(`
SELECT EXISTS (
SELECT 1 FROM bot_config
WHERE date(last_date_msg_receipts) = date('now', 'localtime')
WHERE date(last_date_msg_receipts, 'localtime') = date('now', 'localtime')
) as was_sent_today
`).get();
const debug = db.prepare(`
SELECT
date(last_date_msg_receipts) AS last_date,
date(last_date_msg_receipts, 'localtime') AS last_date,
datetime('now', 'localtime') AS current_time_full,
(date(last_date_msg_receipts) = date('now', 'localtime')) AS was_sent_today
(date(last_date_msg_receipts, 'localtime') = date('now', 'localtime')) AS was_sent_today
FROM bot_config
LIMIT 1;
`).get();
if (!notification.was_sent_today) {
await channel.send(`\`\`\`SELECT
date(last_date_msg_receipts) AS last_date,
date(last_date_msg_receipts, 'localtime') AS last_date,
datetime('now', 'localtime') AS current_time_full,
(date(last_date_msg_receipts) = date('now', 'localtime')) AS was_sent_today
(date(last_date_msg_receipts, 'localtime') = date('now', 'localtime')) AS was_sent_today
FROM bot_config
LIMIT 1;\`\`\`