Receipts: Split dev and production channels.
Fix missing date utils import
This commit is contained in:
@@ -5,7 +5,8 @@ module.exports = {
|
|||||||
async execute(message) {
|
async execute(message) {
|
||||||
if (message.author.bot) return;
|
if (message.author.bot) return;
|
||||||
|
|
||||||
if(message.channel.id === '1462060674766344370') {
|
const receiptsChannelId = process.env.NODE_ENV === 'development' ? '1468186493251227658' : '1462060674766344370';
|
||||||
|
if(message.channel.id === receiptsChannelId) {
|
||||||
const CURRENCY_MAP = {
|
const CURRENCY_MAP = {
|
||||||
"222457277708369928": "EUR", // Minz
|
"222457277708369928": "EUR", // Minz
|
||||||
"372115788498468864": "SEK", // Miffy
|
"372115788498468864": "SEK", // Miffy
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
|
const { formatDate } = require('../core/utils.js');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
immediate: true,
|
immediate: true,
|
||||||
name: 'Receipt Day Announcements',
|
name: 'Receipt Day Announcements',
|
||||||
data: {
|
data: {
|
||||||
channelId: '1462060674766344370',
|
channelId: process.env.NODE_ENV === 'development' ? '1468186493251227658' : '1462060674766344370',
|
||||||
targetHour: 0,
|
targetHour: 0,
|
||||||
targetMinute: 1
|
targetMinute: 1
|
||||||
},
|
},
|
||||||
@@ -55,15 +57,15 @@ module.exports = {
|
|||||||
const notification = db.prepare(`
|
const notification = db.prepare(`
|
||||||
SELECT EXISTS (
|
SELECT EXISTS (
|
||||||
SELECT 1 FROM bot_config
|
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
|
) as was_sent_today
|
||||||
`).get();
|
`).get();
|
||||||
|
|
||||||
const debug = db.prepare(`
|
const debug = db.prepare(`
|
||||||
SELECT
|
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,
|
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
|
FROM bot_config
|
||||||
LIMIT 1;
|
LIMIT 1;
|
||||||
`).get();
|
`).get();
|
||||||
@@ -71,9 +73,9 @@ module.exports = {
|
|||||||
|
|
||||||
if (!notification.was_sent_today) {
|
if (!notification.was_sent_today) {
|
||||||
await channel.send(`\`\`\`SELECT
|
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,
|
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
|
FROM bot_config
|
||||||
LIMIT 1;\`\`\`
|
LIMIT 1;\`\`\`
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user