timezone option

This commit is contained in:
Jacob Janzen 2024-12-11 11:19:09 -06:00
parent 88d693e804
commit a6cc1be0ef

13
app.js
View file

@ -21,9 +21,19 @@ client.on('ready', () => {
Object.keys(jobs).forEach((job) => {
job_crons[job] = cron.schedule(jobs[job].crontab, () => {
client.channels.cache.get(jobs[job].channel_id).send(jobs[job].message);
}, {
scheduled: true,
timezone: process.env.TIMEZONE
});
});
});
client.user.setPresence({
activities: [{
name: 'sily'
type: ActivityType.Playing,
}],
status: "idle"
});
});
client.login(process.env.DISCORD_TOKEN);
@ -57,6 +67,9 @@ app.post('/', verifyKeyMiddleware(process.env.PUBLIC_KEY), async function (req,
};
job_crons[id] = cron.schedule(crontab, () => {
client.channels.cache.get(req.body.channel_id).send(message);
}, {
scheduled: true,
timezone: process.env.TIMEZONE
});
const json = JSON.stringify(jobs);